All, I am trying to write a project using the java restful service by jersey. I get problems "The ResourceConfig instance does not contain any root resource classes". I've tried all solutions from here and it didn't work.
I create a new project named "test"
The web.xml is :
<servlet> <servlet-name>Jersey REST Service</servlet-name> <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class> <init-param> <param-name>com.sun.jersey.config.property.packages</param-name> <param-value>test</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>Jersey REST Service</servlet-name> <url-pattern>/api/*</url-pattern> </servlet-mapping>
A simple service:
@Path("/message") public class MessageRestService { }
Also I change the classes built path into /WEB-INF/classes
And I start the project in tomcat 7 also tried 8, the problem is still there