Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

REST(Jersey + Jetty).. Why my jetty server says 404 when i have that URL  RSS feed

 
Anish Shah
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I searched this forum.. found a similar topic but not the answer...

Case: I am implementing a REST framework with Jersey.. My server is Jetty..
Link: The base of my implementation and problem...How do i create an embedded Jetty instance that uses Jersey

Alright, now the exception thrown..

I have a DataBean, Resource class and a Jetty class which creates a jetty instance based on the above link..
Below is the launch method in Jetty class:

com.n2bb.srm.web.resource.. this package has my resource class

Client code in a different project:

Why is my server responding with 404 not found error... What am i doing wrong ??

Thank you very much...
 
Anish Shah
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK.. somehow i got it to work..

Change i made..



to



Now i don't get this ?? I am not able to find my correct path..

What would happen if i have to add multiple servlets... the /* would already have loaded everything...
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the /* would already have loaded everything...

... which suggests that mapping a servlet to "/..." is not generally a good idea.
 
Anish Shah
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:
the /* would already have loaded everything...

... which suggests that mapping a servlet to "/..." is not generally a good idea.


OK.. i tried every other combination to find the actual URL..
I tried...
/
/srm
/srm/
srm/ --- exception
/*srm
/*srm*
/srm*
" " -- blank..

Only /* works which means it loads everything

Now what if i want to add a new servlet down the line...
Something like


Now i already have

Whats going to happen in this scenario...

Also.. off the topic..
Every Servet container(like Jetty in my case) can support a max of 1 ServletContext right ??

Thank you...
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!