3

I am getting the following exception when deploying my war file in Tomcat 6

java.lang.ClassNotFoundException: com.google.gwt.user.client.rpc.RemoteService

So I tried to use just the most simplest gwt project by using webAppCreator:

The class it is trying to load is not in gwt-servlet.jar but does exist in gwt-user.jar. All places say I don't need gwt-user.jar to be deployed. This is with gwt 2.5.1. HELP!!!

used webAppCreator as follows:

webAppCreator com.mytest.TestGwtRpc

Then used the build.xml to create the war file. Deployed in Tomcat 6. started up and clicked the send button and get the following:

java.lang.NoClassDefFoundError: com/google/gwt/user/client/rpc/RemoteService

root cause

java.lang.ClassNotFoundException: com.google.gwt.user.client.rpc.RemoteService

2
  • Have you compiled the GWT sources? REmoteService is a client interface that should not be deployed on a server. Commented Dec 9, 2013 at 22:35
  • The server side implementation however implements the interface that extends RemoteService: [public class GreetingServiceImpl extends RemoteServiceServlet implements GreetingService ] [public interface GreetingService extends RemoteService] Commented Dec 10, 2013 at 0:28

1 Answer 1

3

RemoteService definitely is in gwt-servlet.jar of gwt-2.5.1.

So try unzipping your war file, and verify that gwt-servlet.jar is at

war/WEB-INF/lib/gwt-servlet.jar

I assume, that the jar is probably not there? But if it is, unzip gwt-servlet.jar, and verify that the class is at

com/google/gwt/user/client/rpc/RemoteService.class

If it's actually there, then probably something else is going on with deployment (maybe clean up tomcat's work dir, and make sure that there are no other wars deployed which could cause the error, ...)

Sign up to request clarification or add additional context in comments.

3 Comments

It most certainly is not in my 2.5.1 gwt-servlet.jar. I did an untar and that file is not there in gwt-servlet.jar. I have the list of files from my "tar -vtf gwt-servlet.jar" and the RemoteService is definitely not there.
I went and downloaded the gwt-servlet-2.5.1.jar from GWT maven and it is in that one, so I will try using it. Thanks! The one the came with the GWT SDK download does not for some reason, or at least the one I have.
Interesting - for me, both the Maven version and the one from the GWT 2.5.1 SDK download contain the class... But I've encountered some people with broken GWT jars recently, very mysterious.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.