1) Get your application to run successfully in the development or hosted mode. Make sure that URL's used by the service entry points are of the form
String moduleRelativeURL = GWT.getModuleBaseURL() + "/mediaplayer";
The assumption is that the GWT XML file that you created for you application configuration looks like the one below and your servlet path is /mediaplayer.
<module>
<!-- Inherit the core Web Toolkit stuff.-->
<inherits name='com.google.gwt.user.User'/>
<!-- Specify the app entry point class.-->
<entry-point class='com.test.client.MediaPlayer'/>
<servlet path='/mediaplayer' class='com.test.server.MediaPlayerServices'/>
</module>
2) Run the command mediaplayer-compile.cmd which GWT would have created for your application.
3) On the server side where Tomcat is running ,navigate over to the webapps directory . Under it create the following subtree.
webapps/MediaPlayer
webapps/MediaPlayer/WEB-INF
webapps/MediaPlayer/classes
webapps/MediaPlayer/lib
The assumption here is that your application is named MediaPlayer.
4) In your GWT application directory you will see a bunch of html,xml,css,js and gif files under the www/com.test.mediaplayer directory created whenever you ran your application in the hosted mode. Copy all the these files to your server into the webapps/MediaPlayer directory.
5) Create a web.xml file under webapps/MediaPlayer/WEB-INF to configure your application for Tomcat. It should look like
<web-app>
<servlet>
<servlet-name>MediaPlayer</servlet-name>
<servlet-class>com.test.server.MediaPlayerServices</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>MediaPlayer</servlet-name>
<url-pattern>/mediaplayer</url-pattern>
</servlet-mapping>
</web-app>
Note that the parameters you specify here should match the ones in your GWT application configuration xml file in your development area. In this example all the RPC interfaces are defined in a single class "MediaPlayerServices" and so there is a single servlet definition.
6) Copy your compiled class hierarchy under the bin directory for your GWT application area to the server under webapps/MediaPlayer/classes. The directory hierarchy should look exactly the same under bin on your client side and under "webapps/MediaPlayer/classes" on your server side.
└───com
└───test
├───client
├───public
└───server
Note the you do not really need to copy the public subdirectory. Also you do not need all the class files under the client sub directory. You only need the class that defines the RPC interfaces which in my case is called "MediaPlayerService.class".
7) The last step is to copy a couple of the jars that come with the GWT into the webapps/MediaPlayer/lib directory. The ones you need are "gwt-servlet.jar" and "gwt-user.jar". You can also copy other jar files related to libraries you used on the server side like the MySQL connector into this directory.
You should now be able to access your application on a browser using the URL
"http://10.0.0.1:8080/MediaPlayer/mediaplayer.html" where 10.0.0.1 is the host on which Tomcat is deployed and 8080 is the port it is listening on.