Java Jersey Rest : No provider classes found. (404 error when accessing URL)?

Up vote 1 down vote favorite share g+ share fb share tw.

Edit: I hadn't realized that all request were first going into "Apache" and then were redirected to Tomcat. I added a new redirection in the apache2. Conf file.

See the accepted answer for details. I am having the exact same problem as this question. Jersey REST The ResourceConfig instance does not contain any root resource classes However the user never answered the question.

I am using Tomcat, without maven. I followed this tutorial. ibm.com/developerworks/web/library/wa-aj... I made changes to web.

Xml as per the article i. E the new servlet and servlet mapping was created with the correct package name. Jersey REST Service com.sun.jersey.spi.container.servlet.

ServletContainer com.sun.jersey.config.property. Packages sample.hello. Resources 1 Jersey REST Service /rest/* I have deployed the following jars to tomcat asm.

Jar jersey-server. Jar jersey-core. Jar jsr311.

Jar The tomcat startup log has the following exceptions. Com.sun.jersey.api.core. PackagesResourceConfig init INFO: Scanning for root resource and provider classes in the packages: sample.hello.

Resources com.sun.jersey.api.core. ScanningResourceConfig logClasses INFO: Root resource classes found: class sample.hello.resources. HelloResource com.sun.jersey.api.core.

ScanningResourceConfig init INFO: No provider classes found. Com.sun.jersey.server.impl.application. WebApplicationImpl _initiate INFO: Initiating Jersey application, version 'Jersey: 1.8 06/24/2011 12:17 PM' When I access the URL I get a 404.

http://localhost:8080/Jersey/rest/hello The code: import javax.ws.rs. GET; import javax.ws.rs. Path; import javax.ws.rs.

Produces; import javax.ws.rs.core. MediaType; @Path("/hello") public class HelloResource { @GET @Produces(MediaType. TEXT_PLAIN) public String sayHello() { return " } } I do not see any other exceptions in the logs java apache tomcat rest jersey link|improve this question edited Feb 20 at 21:40Chadwick3,63031035 asked Jul 5 '11 at 15:32kensen john1,364410 89% accept rate.

It would help if you posted the web. Xml and the sample.hello.resources. HelloResource class as well.

– gnuf Jul 5 '11 at 15:41 @gnuf added code and web. Xml – kensen john Jul 5 '11 at 15:46 1 Those don't look like exceptions to me in your log, just informational messages. That IBM tutorial says something about creating a web app named Jersey using Eclipse.

I'm not familiar with deploying to Tomcat via Eclipse, but are you certain that Jersey is the right deployment path? That is, have you tried browsing to localhost:8080/rest/hello? – gnuf Jul 5 '11 at 18:14 The context path is without changing it like the Eclipse project name.

You can investigate this easily by drill down the projects tree of you Tomcat in your Eclipse Server view. But it is possible to change the context path in your project properties at the Web Project Settings tab. However the path should be "localhost:port/Eclipse project name/rest/hello – Omnaest Jul 5 '11 at 20:24 shouldn't the @Path be "/rest/hello"?

I never know, and just map the servlet to /* :-) – Szocske Jul 5 '11 at 21:06.

Verify you have the right URL: The tomcat manager application is happy to direct you to the root URL of the servlet. (you are assuming this is "Jersey" with capital J. ) http://localhost:8080/manager/html/list Then you can skip the "rest" part by setting the URL pattern in the servlet mapping of the web.

Xml to "/*" (yes, there was a bug in Jersey related to that once, but that's ancient history) Then you can append "application. Wadl" to get a description of available resources. Theoretically: http://localhost:8080/Jersey/application.wadl.

By default, Tomcat uses war file name or name of the top most directory of the exploded war as root context unless defined in catalina_home/conf/server. Xml, catalina_home/conf/context. Xml or in application's META-INF/context.

Xml file. To access http://localhost:8080/Jersey/rest/hello, the context entry should be and your resource should have @Path("/rest/hello").

This issue was resolved as follows. My localhost has been setup with "Apache" webserver which redirects all requests to Tomcat. Since "Jersey" is using a new servlet, I had to create a separate redirect for this servlet specifically.

In Linux /etc/apache2/apache2. Conf add: JkMount /rest/* ajp13_worker.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions