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>
Similar Posts:
- [Solved] Warning: Servlet threw load() exception java.lang.ClassNotFoundException: org.glassfish.jersey.servlet…
- [Solved] Spring Error: Artifact spring:war exploded: Error during artifact deployment. See server log for details
- [Solved] IDEA javaweb web.xml File Error: Invalid content was found starting with element
- Struts 2.0 Error: The Struts dispatcher cannot be found (Error 500 Internal Server Error)
- Error 404 when accessing pictures in the project directory
- How to Solve Error: The content of element type “web-app” must match “(icon?display
- [Solved] Spring MVC cross server upload error: returned a response status of 405 method not allowed
- [Solved] IDEA: JSP Could Not Use session Build-in Object
- Tomcat set x-frame-option
- Spring MVC: How to Solve Chinese garbled code Issue