This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes RESTful service with EJB 3.1 endpoint cannot be found (404) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "RESTful service with EJB 3.1 endpoint cannot be found (404)" Watch "RESTful service with EJB 3.1 endpoint cannot be found (404)" New topic
Author

RESTful service with EJB 3.1 endpoint cannot be found (404)

a sarkar
Ranch Hand

Joined: Aug 05, 2010
Posts: 92
Hi,
I have a Resource configured as a EJB 3.1 Stateless Bean. I also have an overridden Application class to customize the context root. However, the client just cannot seem to find the Resource. What am I doing wrong? The Resource is packaged and deployed as a war.



Resource:


Application class:



Client:


Abhijit
-------
SCJP 5, SCBCD 5, OCWCD 5, OCEWSD 6, CSM
a sarkar
Ranch Hand

Joined: Aug 05, 2010
Posts: 92
I figured this out...the context root is NOT the one specified in the @ApplicationPath annotation. The context root has to be specificed in the vendor-specific dd, glassfish-web.xml for example, or the default needs to be accepted.
The endpoint URI is of the form http://hostname:port/contextRoot/applicationPath/path, where applicationPath is specific with @ApplicationPath and path with @Path.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: RESTful service with EJB 3.1 endpoint cannot be found (404)
 
Similar Threads
Restful resource with a SpringServlet
Dependency injecton failed with Glassfish
AJAX response to a Restful Jersey Resource
RESTful Java Client - Post Data Help neede
Glassfish v3. javax.ejb.CreateException: Could not create stateless EJB