The activator for bundle is invalid

后端 未结 14 2131
-上瘾入骨i
-上瘾入骨i 2020-12-30 04:31

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

相关标签:
14条回答
  • 2020-12-30 04:45

    This can also happen if you name a bundle after a package in another bundle.

    So:

    • if you have Bundle A which contains package org.my.package.name.function,
    • and you create bundle B with name org.my.package.name.function,
      • => then the system may look for the activator there, and not find any.
    0 讨论(0)
  • 2020-12-30 04:46

    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)

    0 讨论(0)
  • 2020-12-30 04:47

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

    0 讨论(0)
  • 2020-12-30 04:49

    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

    0 讨论(0)
  • 2020-12-30 04:52

    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.

    0 讨论(0)
  • 2020-12-30 04:54

    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.

    0 讨论(0)
提交回复
热议问题