【问题标题】:OSGi NoClassDefFoundError when running outside of Eclipse with my Bundle使用我的 Bundle 在 Eclipse 之外运行时出现 OSGi NoClassDefFoundError
【发布时间】:2012-04-06 17:45:44
【问题描述】:

我有一个由多个捆绑包组成的应用程序。在 Eclipse 内部,它运行良好。当我将它作为产品导出时,它运行良好,但发生了一些变化,我不知道是什么。

现在,当我导出我的包时,在运行时我得到 NoClassDefFoundError。错误在我的包的一个激活器中,它无法找到的类在另一个包中。一个普通的捆绑包。

当我尝试启动捆绑包时出现异常

Caused by: java.lang.NoClassDefFoundError: com/ardor/common/util/Systems

这个类在我的另一个包 com.ardor.common 中。 在控制台上,当我使用“bundle”命令检查这个包时,我得到了

Exported packages
com.ardor.common.util; version="0.0.0"[exported]

我被想法困住了:(

【问题讨论】:

  • 午夜编码会带来额外的困难。似乎问题在于我导出的包 jar 有一个清单,但实际上没有类文件。

标签: eclipse export osgi bundle noclassdeffounderror


【解决方案1】:

当我试图删除我从 build.properties 中删除的编译器警告时

输出.. = bin/

没有这个包不包含任何类文件

build.properties

source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-02-11
    • 2023-04-08
    • 2012-10-24
    • 2012-12-01
    • 2016-01-11
    • 1970-01-01
    • 2011-10-09
    • 1970-01-01
    相关资源
    最近更新 更多