Java EE、GWT、NoClassDefException
我有一个基于 GWT(谷歌网络工具包)和 JPA(eclipselink 2.3)构建的应用程序。它不使用 GAE(应用程序引擎)。
当我完成应用程序时,我在 Eclipse 中运行“google->gwtcompile”菜单,然后将 /war 内容上传到 tomcat 目录...
应用程序正在运行,但是当我尝试在 gui 中执行一项特定操作时,我得到一个错误消息和 Tomcat 日志包含此异常: http://paste2.org/p/1879857 (java.lang.NoClassDefFoundError)
在应用程序的开发过程中,我多次遇到这种异常,每次发生都是由于 war/WEB-INF/lib/... 中缺少库 .jar 文件引起的,我将 .jar 存储到该文件夹中并且它起作用了...但这次不行...
这个类位于 gwt-dev.jar 中(是的,它在那里 - 已经搜索了存档)并且它对我没有帮助将存档存储到 lib/ 文件夹...
它也包含在内在类路径中,编译器没有问题...编译完成,没有错误(因此编译器可以看到该类)。
你有什么想法,如何让tomcat看到课程吗?
谢谢
I have an app, built on GWT (google web toolkit) and JPA (eclipselink 2.3). it's not using GAE (app engine).
when I finished application, I ran 'google->gwt compile' menu in eclipse and then uploaded /war content to the tomcat directory...
application is running, but when I try to do one specific action in gui, I get an error message and Tomcat log contains this exception: http://paste2.org/p/1879857 (java.lang.NoClassDefFoundError)
during development of the application, I encountered this kind of exception several times, it was always caused by absence of library .jar file in the war/WEB-INF/lib/... anytime it has occurred, I stored .jar to the folder and it worked... but not this time...
this class is located in gwt-dev.jar (yes, it is there - have searched the archive) and it didn't help me to store archive to the lib/ folder...
it is also included in classpath, and compiler had no problem... compilation finished without errors (so compiler can see the class).
do you have any idea, how to make tomcat to see the class?
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
gwt-dev.jar
不应位于WEB-INF/lib/
中,它是 GWT 编译器,不应在运行时需要或使用。同时,该 HashSet(com.google.gwt.dev.util.collect.HashSet
,开发模式的一部分)不应在编译器外部使用 - 使用java.util .HashSet 代替。
gwt-dev.jar
shouldn't be inWEB-INF/lib/
, it is the GWT compiler, and shouldn't be needed or used at runtime. At the same time, that HashSet (com.google.gwt.dev.util.collect.HashSet
, part of dev mode) shouldn't be used outside the compiler - usejava.util.HashSet
instead.将
GroupImpl.java
中的HashSet
导入从com.google.gwt.dev.util.collect.HashSet
更改为java.util .HashSet
。您不需要gwt-dev.jar
来运行您的应用程序。Change the
HashSet
import inGroupImpl.java
fromcom.google.gwt.dev.util.collect.HashSet
tojava.util.HashSet
. You shouldn't needgwt-dev.jar
to run your application.