I\'m trying to create a simple plugin in eclipse. When I run the application, I see this error in log file:
org.osgi.framework.BundleException : The a
This can also happen if you name a bundle after a package in another bundle.
So:
Bundle A
which contains package org.my.package.name.function
, bundle B
with name org.my.package.name.function
,
I also met the same error. The activator XX for bundle XX is invalid, and the ClassNotFoundException. I checked plugins\ directory, and could not find the class needed.
-- Because there is no jar file containing the needed class, there is only the corresponding directory. For example, there is no com.hh.jar, but only com.hh directory.
So, there must be something wrong about creating the com.hh.jar.
if com.hh.jar reference other plugins, then also check them.
I solved the problem by editing MANIFEST.MF. Open it by Plug-in Manifest Editor, in runtime tab, add needed packages in "Exported Packages". and in the "classpath", add needed libraries, and, "." (current directory, IMPORTANT)
In my case there was this Message "Activator ..invalid" but in the next exceptions there were ClassNotFound Exceptions in a Bundle were i didnt change something..
Guu(Posted a solution too) is my hero, After increasing
Bundle-ManifestVersion: 2
to
Bundle-ManifestVersion: 3
everything works :)
I got the same exception. The underlying problem was a ClassCastException. My bundle requires org.osgi.core 4.3 whereas the equinox launcher uses 4.2.
Regards Roland
OK, I hate to be captain obvious here, but I've made this mistake before. This can also happen when you forget to extend BundleActivator.
Another captain obvious: If you change the paths of your source files (e.g. src/ to src/main/java), but forget to update build.properties, the compilation will always succeed, but your plugin will never work.