我已经搜索了一段时间,没有找到任何解决方案为我工作。所以我转向你。
当我试图集成BIRT (一个用于报告和文档的eclipse插件)的API时,我得到了一个java.lang.NoClassDefFoundError。我复制粘贴他们的代码,在lib文件夹中包含所有的jar文件(birt-运行时-4_2_2\ReportEngine\lib),但我仍然得到NoClassDefFoundError。我做错了什么?我在他们的网页上找不到任何有用的信息。此外,我已经尝试了几个其他的源代码,但我仍然遇到同样的问题。所以我认为jar文件的导入可能是错误的。但我不能因为上帝的爱而找错。
我粘贴的代码(只是为了试用)可以在这里找到:%28BIRT%29
完整的错误消息如下:
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/core/runtime/Platform
at org.eclipse.birt.core.framework.jar.ServicePlatform.getExtensionRegistry(ServicePlatform.java:72)
at org.eclipse.birt.core.framework.jar.ServicePlatform.createFactoryObject(ServicePlatform.java:98)
at org.eclipse.birt.core.framework.Platform$1.run(Platform.java:297)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.birt.core.framework.Platform.createFactoryObject(Platform.java:293)
at org.eclipse.birt.report.model.api.DesignEngine.<init>(DesignEngine.java:90)
at org.eclipse.birt.report.model.api.DesignEngine.newSession(DesignEngine.java:142)
at standard.Main.main(Main.java:36)
Caused by: java.lang.ClassNotFoundException: org.eclipse.core.runtime.Platform
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 8 more发布于 2013-07-26 12:24:37
除了Birt的jar文件之外,您还必须将一些额外的jar从Birt运行时复制到Tomcat的WEB文件夹中。
我也遇到了类似的问题,这对我很有帮助。看看我的问题:NoClassDefFoundError for Birt Class EngineException
https://stackoverflow.com/questions/16608234
复制相似问题