OSGi java.lang.NoClassDefFoundError: org/osgi/framework/BundleContext

非 Y 不嫁゛ 提交于 2020-01-05 10:05:35

问题


I'm new with OSGi and I'm having trouble trying to run an example of this library: https://github.com/jitsi/libjitsi

java.lang.NoClassDefFoundError: org/osgi/framework/BundleContext
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
at java.lang.Class.getConstructor0(Class.java:3075)
at java.lang.Class.newInstance(Class.java:412)
at org.jitsi.service.libjitsi.LibJitsi.start(LibJitsi.java:247)
at org.jitsi.service.libjitsi.LibJitsi.start(LibJitsi.java:180)
at com.dotsystem.AVTransmit2.main(AVTransmit2.java:327)
Caused by: java.lang.ClassNotFoundException: org.osgi.framework.BundleContext
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 7 more

Do I need an external jar for osgi?


回答1:


A class not found exception on a core osgi class, seems that you are missing a jar/framework jar that implements OSGi specification. Check which OSGi implementation your target system supports. If you have choice in choosing you can try,

  1. Apache felix OSGi
  2. Eclipse equinox OSGi



回答2:


If you are trying to run example from IntelliJ it may be problem that you haven`t imported maven dependencies. When you import java project into IntelliJ you must also import its dependencies (they are not imported by default).



来源:https://stackoverflow.com/questions/43781490/osgi-java-lang-noclassdeffounderror-org-osgi-framework-bundlecontext

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!