- Installed Tomcat 6
- Installed Eclipse + GWT plugin
- Created GWT project with sample
generated code - Compliled GWT project (GWT compile)
- Copied war (compiled) directory from
eclipse’s workspace to TOMCAT
webapps/ROOT folder - Run localhost:8080 at my browser
The sample.html page from the GWT project displays correct but when i try to make a server call an error occurs.
- No problem with jetty
(Eclipse GWT develpment mode) – rpc
work’s fine - PROBLEM at TOMCAT.
The catalina.out log at TOMCAT says:
Error deploying web application
directory ROOT
java.lang.UnsupportedClassVersionError:
Bad version number in .class file
(unable to load class
com.tomcat.server.GreetingServiceImpl)
I guess there might be a problem at WEB_INF/web.xml at servlet definition, here’s my web.xml
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<display-name>Welcome to Tomcat</display-name>
<description>
Welcome to Tomcat
</description>
<!-- Servlets -->
<servlet>
<servlet-name>greetServlet</servlet-name>
<servlet-class>com.tomcat.server.GreetingServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>greetServlet</servlet-name>
<url-pattern>/tomcat/greet</url-pattern>
</servlet-mapping>
<!-- Default page to serve -->
<welcome-file-list>
<welcome-file>Tomcat.html</welcome-file>
</welcome-file-list>
</web-app>
I had this same issue when I deployed to my Godaddy hosting server. It worked fine on my local machine but not when I deployed. I got the same exact error message. The problem is you compiled your code with a version of java that is newer then that of which Tomcat is using.
This worked for me, if it doesn’t for you then….ya…it should work. Good luck