Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Deploying a Jersey REST Web Service to Tomcat

 
Mike London
Ranch Hand
Posts: 1208
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65218
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(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.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Mike London
Ranch Hand
Posts: 1208
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic