Tag Archives: com.sun.jersey.api.container.ContainerException

[Solved] com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes

com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes

jersey error in the configuration file web.xml is not written correctly!

The reason for the error: I wrote the wrong configuration file in my web.xml.

<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>

<! — This below is the package name of the class in your project! . Don’t write it wrong. Otherwise you will get the error above –>

<param-value>org.pk.rest.tests</param-value>

</init-param>

<load-on-startup>1</load-on-startup>

</servlet>

<servlet-mapping>

<servlet-name>Jersey REST Service</servlet-name>

<url-pattern>/rest/*</url-pattern>

</servlet-mapping>