且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

尝试在Tomcat中部署GWT项目,结束违规类错误

更新时间:2023-08-21 13:35:04

p> 你不应该部署 gwt-user.jar 和/或 gwt-dev.jar



如果您使用GWT-RPC或RequestFactory,则部署 gwt-servlet.jar 如果您不使用托管依赖关系(Maven等),您可能还必须部署 gwt-servlet-deps.jar ,您可以在GWT SDK中找到拉链捆绑。否则,你的依赖管理器(Maven等)应该照顾你的传递依赖。



如果你使用托管依赖关系,把 gwt- gwt-dev 中提供范围(或任何相当于您的构建工具/依赖关系管理器,如果您不使用Maven)。



请参阅 http://www.gwtproject.org/doc/latest/DevGuideDeploying.html#DevGuideDeployingServletContainerUsingRPC


I'm trying to deploy my GWT project in Tomcat but i'm always getting this error:

Jul 16, 2013 9:16:52 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(C:\Users\Dennis\Documents\workspaceMA\xampp\tomcat\webapps\rfds\WEB-INF\lib\gwt-dev.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class

When i'm trying to open the webpage i get following error:

HTTP Status 404 - /rfds/
type Status report
message /rfds/
description The requested resource is not available.
Apache Tomcat/7.0.41

After searching these jar files in mit web-inf/lib directory i found a gwt-dev.jar (about 33Mb) and a gwt-servlet.jar (about 6Mb) and about 10-20 other jar files regarding other tools i used in my project (membrain, drools, jdbc driver etc.). Do I have dependency issues? Has someone an solution for this problem?

Thanks in advance!

Thou shall never deploy gwt-user.jar and/or gwt-dev.jar!

Deploy gwt-servlet.jar if you use GWT-RPC or RequestFactory. If you're not using managed dependencies (Maven, etc.) you might have to deploy gwt-servlet-deps.jar too, which you'll find in the GWT SDK zip bundle. Otherwise, your dependency manager (Maven, etc.) should take care of transitive dependencies fro you.

If you use managed dependencies, put gwt-user and gwt-dev in the provided scope (or whatever is equivalent for your build tool / dependency manager if you're not using Maven).

See http://www.gwtproject.org/doc/latest/DevGuideDeploying.html#DevGuideDeployingServletContainerUsingRPC