aspose file tools*
The moose likes Web Services and the fly likes Deploying a Jersey REST Web Service to Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Deploying a Jersey REST Web Service to Tomcat" Watch "Deploying a Jersey REST Web Service to Tomcat" New topic
Author

Deploying a Jersey REST Web Service to Tomcat

Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 1034
Hello,

I'm wondering how you deploy a REST web service to Tomcat.

The code Intellij creates for the "helloworld" service has a "main" method for testing. That works fine, but when I try to add Tomcat into the mix as a separate deployment, it doesn't work at all. I'm clearly doing something wrong and am confused about deploying REST web services under Tomcat.

I'm not sure what's special about port 9998 used in the sample code or if that port was just chosen at (sort-of) random.

Would appreciate any tips on getting the Jersey "HelloWorld" app to run by itself under Tomcat. Doesn't appear to be your typical "Web app" from a deployment perspective.

Thanks,

-mike
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60059
    
  65

(Me again.) It should be. There's no reason for it not to be a typical JEE web app.

Personally, I use IntelliJ as an editor on steroids, but run a standalone Tomcat instance.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39549
    
  27
Indeed, Jersey can be deployed as part of any web app. The Jersey docs unfortunately complicate matters needlessly by wanting to use Maven, and by setting up some test harness outside of a servlet container. A quick search for "example jersey web app" found http://www.ibm.com/developerworks/web/library/wa-aj-tomcat/, which looks like a good starting point. It talks about Jersey 1.0, but you should be able to substitute a current 1.1 version w/o problems.


Ping & DNS - updated with new look and Ping home screen widget
Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 1034
Bear Bibeault wrote:(Me again.) It should be. There's no reason for it not to be a typical JEE web app.

Personally, I use IntelliJ as an editor on steroids, but run a standalone Tomcat instance.


Yeah, I'm trying to use Intellij also. I love Intellij once the project is set up -- as an editor that really "knows my code" and does excellent refactoring, etc.. Best editor available, IMHO.

-mike

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Deploying a Jersey REST Web Service to Tomcat
 
Similar Threads
How to write a RESTful web service with Eclipse tutorial that assumes very little?
How to deploy a RESTful Web Service
Who's using Jersey for JAX-RS (JSR-311)?
Getting com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Exception
Cant Run Simple Jersey REST Webservice Example