Search code examples
mavengwtgwtp

Deploying a gwtp maven app: See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class


Using the directions at https://github.com/ArcBees/ArcBees-tools/blob/master/archetypes/gwtp-basic/README.md and http://c.gwt-examples.com/home/maven/ide-import/eclipse I've created a GWTP project with maven. It works well on the debug mode but I'm having problems deploying it.

1) run the command mvn gwt:compile 2) copy the .war file to two different Tomcat servers 3) Restart the server 4) Browse to the location of the file and I get a 404 error

HTTP Status 404 - /transpohubAdmin/Project.html type Status report message /transpohubAdmin/Project.html description The requested resource is not available. Apache Tomcat/7.0.32

This error occurs also if I go directly to a css file (unless I delete the Project.html file first)

The catalina.out is:

May 2, 2013 9:22:01 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /usr/local/apache-tomcat-7.0.32/webapps/transpohubAdmin.war
May 2, 2013 9:22:02 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/Library/Tomcat/webapps/transpohubAdmin/WEB-INF/lib/gwt-user-2.5.1.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
May 2, 2013 9:22:02 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
May 2, 2013 9:22:02 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/transpohubAdmin] startup failed due to previous errors

I've googled See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class and not found any help with this error.

Any suggestions?

Cheers,


Solution

  • You shouldn't have gwt-user in your WAR. There should be gwt-servlet if your use GWT-RPC, or requestfactory-server if you use RequestFactory.

    In other words, the gwt-user dependency in the pom.xml should have <scope>provided</scope> and you should add a dependency on gwt-servlet with <scope>runtime</scope>.

    Please file an issue on Brandon's archetype.