org.osgi.framework.BundleActivator 的 ClassNotFoundException 尽管有导入包 [英] ClassNotFoundException for org.osgi.framework.BundleActivator despite of Import-Package

查看:164
本文介绍了org.osgi.framework.BundleActivator 的 ClassNotFoundException 尽管有导入包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我再次尝试使用激活器运行一个非常简单的 OSGiHello World"样式示例,并得到 org.osgi.framework.BundleActivator 的 ClassNotFoundException(参见下面的堆栈跟踪).

I tried running a really simple OSGi "Hello World"-style example with an activator after a longer while again and got a ClassNotFoundException for org.osgi.framework.BundleActivator (see stack trace below).

环境是基本的Equinox(org.eclipse.osgi_3.7.2...).所有捆绑包(除了我的)都是 ACTIVE.我在清单中的Import-Package"声明中有org.osgi.framework",我可以在 Eclipse 的包依赖项中看到该类.

The environment is basic Equinox (org.eclipse.osgi_3.7.2...). All bundles (besides mine) are ACTIVE. I have "org.osgi.framework" in my "Import-Package" declaration in the manifest, and I can see the class in the package dependencies in Eclipse.

有人可以提示我尝试解决此问题的方法吗?

Can someone give me a hint on what to try to troubleshoot this?

亲切的问候,安德烈

Caused by: java.lang.ClassNotFoundException: org.osgi.framework.BundleActivator
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 30 more

推荐答案

抱歉我自己回答了这个问题,但其他人可能有类似的令人困惑的问题.发生的事情是有一个第三方库(在本例中为 Jersey)需要我包含的更新版本的 OSGi.因此,该库找不到(正确版本的)BundleActivator.

Sorry for answering this myself, but others might have a similar confusing issue. What happened was that there was a third party library (in this case Jersey) requiring a newer version of OSGi that I had included. Hence that library could not find (the right version of) BundleActivator.

这篇关于org.osgi.framework.BundleActivator 的 ClassNotFoundException 尽管有导入包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆