1

我有一个简单的测试程序,旨在使用 Apache Felix Bundle Repository 捆绑服务,但是我无法通过 eclipse 配置它。

我使用捆绑包的 jar (org.apache.felix.bundlerepository-1.4.0.jar) 作为引用库,并将其添加到清单中的类路径中。

当我尝试启动我的包时,它给出了错误:

java.lang.ClassCastException: org.apache.felix.bundlerepository.RepositoryAdminImpl cannot be cast to org.apache.felix.bundlerepository.RepositoryAdmin

我无法将 org.osgi.service.obr 添加到我的包中的导入包列表中(因为它没有解决),我认为这是问题的原因。

有任何想法吗?

谢谢

4

1 回答 1

0

通过在 eclipse/plugins 文件夹中包含 Apache Felix Bundle Repository 包 (org.apache.felix.bundlerepository-1.4.0.jar) 解决了这个问题,它允许我在列表中引用 org.osgi.service.obr 包清单中的导入包。

于 2009-08-21T15:58:23.610 回答