The ResourceConfig instance does not contain any root resource classes

Have you tried adding

<init-param>
  <param-name>com.sun.jersey.config.property.packages</param-name>
  <param-value>my.package.name</param-value>
</init-param>

to your SpringServlet definition? Obviously replace my.package.name with the package that AdminUiResource is in and make sure it is in the classpath.


I am new to Jersey - I had the same issue, But when I removed the "/" and just used the @path("admin") it worked.

@Path("admin")
public class AdminUiResource { ... }

YOU NEED TO ADD YOUR PACKAGE NAME AT

<init-param>
  <param-name>com.sun.jersey.config.property.packages</param-name>
  <param-value>your.package.name</param-value>
</init-param>

ALSO ONE SILLY THING I HAVE NOTICED,
I Need to refresh my project after MAVEN BUILD else it show me same error.
Please comment If you know reason why we need to refresh project?


This means, it couldn't find any class which can be executed as jersey RESTful web service.

Check:

  • Whether 'com.sun.jersey.config.property.packages' is missing in your web.xml.
  • Whether value for 'com.sun.jersey.config.property.packages' param is missing or invalid (the mentioned package doesn't exists). It should be a package where you have put your POJO classes which runs as jersey services.
  • Whether there exists at least one POJO class, which has a method annotated with @Path attribute.

Your resource package should contain at least one pojo which is either annotated with @Path or have at least one method annotated with @Path or a request method designator, such as @GET, @PUT, @POST, or @DELETE. Resource methods are methods of a resource class annotated with a request method designator. This resolved my issue...