Integrating GWT with Tomcat and Jersey

77 views
Skip to first unread message

Monika Solanki

unread,
Nov 5, 2011, 9:59:18 AM11/5/11
to google-we...@googlegroups.com
I have managed to successfully integrate a Jersey REST service with a GWT client and the application is running without any problems in the deployment mode. However when I deploy the application on Tomcat, the client is not able to find the jersey service, the path to which has been specified in the client page. The path to the this servlet seems to be correct as the servlet did get deployed on the app engine in the development mode.

Please could someone help me troubleshoot this.

Thanks

Brandon Donnelson

unread,
Nov 5, 2011, 11:39:13 AM11/5/11
to google-we...@googlegroups.com
Try checking the syslog or tomcat logs to see if there is class errors?

Brandon

Monika Solanki

unread,
Nov 6, 2011, 12:40:03 AM11/6/11
to google-we...@googlegroups.com
Hello Brandon,

The problem is that tomcat is trying to look for the file in a folder where there is no jar that holds the servlet classes. My project name is GWTWithJersey. The tomcat log shows me this error

GET /GWTWithJersey/gwtwithjersey/rest/hello HTTP/1.1" 404 1069

The jar files from the project have been bundled as war and the jar files are in the WEBINF/lib folder

When specifying the path to the ResourceBuilder, I pass the path as /rest/hello

How should I specify this path so that it finds the classes in the jar in WEBINF?

Thanks,

Monika


Brandon Donnelson

unread,
Nov 7, 2011, 9:28:55 AM11/7/11
to google-we...@googlegroups.com
What I do is:

If your not using the standalone install:
1. Manually compile the project
2. Zip up the war directory and it should end up something like project.zip (make sure the war directory is the root and not a folder in the zip file)
3. rename the war directory zip file to something like ROOT.war or path.war or GotoHere.war
4. drop the war into the webapps diredtory and it should unzip. If it doesn't unzip it on the server yourself. I like instlall the tomcat manager and deploy that way. 
5. I find you won't have to do any settings but maybe security, but that can be done in a context.xml file if needed. You may have to tell tomcat to observe for context.xml files.

Here are some notes I've put together. 

Hope that helps,
Brandon Donnelson

amos

unread,
Nov 8, 2011, 2:55:51 PM11/8/11
to Google Web Toolkit
Monika,
I'm not sure if this is your issue but the WEBINF directory should
have a dash ('-'): WEB-INF

Tomcat will look for the specific name and then look for the lib
directory under that.

Amos


On Nov 7, 9:28 am, Brandon Donnelson <branflake2...@gmail.com> wrote:
> What I do is:
>
> If your not using the standalone install:
> 1. Manually compile the project
> 2. Zip up the war directory and it should end up something like project.zip
> (make sure the war directory is the root and not a folder in the zip file)
> 3. rename the war directory zip file to something like ROOT.war or path.war
> or GotoHere.war
> 4. drop the war into the webapps diredtory and it should unzip. If it
> doesn't unzip it on the server yourself. I like instlall the tomcat manager
> and deploy that way.
> 5. I find you won't have to do any settings but maybe security, but that
> can be done in a context.xml file if needed. You may have to tell tomcat to
> observe for context.xml files.
>
> Here are some notes I've put together.http://code.google.com/p/gwt-examples/wiki/gwtTomcat
Reply all
Reply to author
Forward
0 new messages