The activator for bundle is invalid

2020-02-25 07:01发布

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 activator for bundle org.x.y.Activator for bundle org.x.y is invalid.

Do you have any idea about this error?

14条回答
虎瘦雄心在
2楼-- · 2020-02-25 07:34

Check your build.properties section

If it doesn't properly specify what's supposed to be in the final binary result, it will not work. Check the .class files are where the MANIFEST.MF says they will be.


from EclipseZone, another reason for this error message:

If you see a message in the log like

 The activator org.example.FooActivator for bundle org.example.foo is invalid 

, then this usually means there has been a ClassNotFoundException trying to load the class in the first place, before it's even got to the start() method.


penguru adds:

The error occurs when I try create a new object from any other class in the constructor of activator class. Isn't it legal to create an object in activator plugin ?

  • If that class if from another plugin which has not yet been "activated", that could be your problem.
  • If that class is not found, that would also invalidate your plugin activator.

Basic advice: you may be better off with your initializations done in the start() method of Activator rather than its constructor.

查看更多
我只想做你的唯一
3楼-- · 2020-02-25 07:34

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 :)

查看更多
登录 后发表回答