The ResourceConfig instance does not contain any root resource classes

I have finished building a web service several times start up tomcat and get the above error even though my classes have @path annotations and my web.xml is properly setup for web services.

Here is a solution I found out, make sure to do a manual project build from Eclipse when you are done working on it. For some unknown reason even though the project is on auto build, the resource configurator did not pick up my new restful project until I did a manual build. The manual build is only required the first time you need to add the restful service to your resources, the servlet entry below is all you need to add to your web.xml to enable restful services to be configured by resource locator.

<servlet>
    <servlet-name>rest</servlet-name>
    <servlet-class>
            com.sun.jersey.server.impl.container.servlet.ServletAdaptor</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
  <servlet-mapping>
    <servlet-name>rest</servlet-name>
    <url-pattern>/rs/*</url-pattern>
  </servlet-mapping>

3 thoughts on “The ResourceConfig instance does not contain any root resource classes

  1. Thanks for the suggestion. After I did what you suggested, things started to work. I think you have managed to pinpoint the real problem.

Leave a Reply