Eclipse RCP:依赖项正确(?),但要获得NoclassDeffoundError
我有一个 RCP 项目,无法修复 NoClassDefFoundError: 一个插件依赖于另一个插件。插件依赖项在清单中设置,导出包,编译时没有错误。这两个插件都位于产品依赖项中,并且在产品的安装详细信息中可见。
但是,当我运行该应用程序时,当一个插件想要使用另一个插件中的类时,我会收到 java.lang.NoClassDefFoundError 错误。
非常感谢任何有关如何找到原因的提示。
谢谢, 迈克尔
I have a RCP project where I cannot fix a NoClassDefFoundError: One plugin depends on another plugin. The plugin-dependencies are set in the manifest, packages exported, and there is no error at compile time. Both plugins are in the product dependencies and visible in the installation details of the product.
But when I run the application I get a java.lang.NoClassDefFoundError when the one plugin wants to use a class from the other plugin.
Any hints how to find the reason for this are greatly appreciated.
Thanks,
Michael
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我发现了问题:我创建的插件无法从现有的 Java 项目加载。不知怎的,我删除了“。”在插件清单中的 Bundle-classpath 条目中(该插件有一些 jar -> 所以 lib/xyz.jar 位于 Bundle-classpath 条目中,但不是“.”)。
对于捆绑包的类加载器,“.”意味着从包的根路径(或类似的路径)搜索类,因此它找不到类。然而IDE中并没有错误,所以很难找到。
I found the problem: I created the plugin which could not be loaded from an existing Java project. And somehow I deleted the "." in the entry Bundle-classpath in the plugin manifest (the plugin has some jars which -> so lib/xyz.jar was in the Bundle-classpath entry but not the ".").
For the class-loader of the bundle the "." means to search for classes from the root path of the bundle (or something like that), so it could not find the classes. However, there were no errors in the IDE so it was hard to find.
运行应用程序的配置是否正确,即所有依赖项也都放入运行配置中?
Is the configuration for running the application correct i.e. all dependencies are also put in the running configuration?