I need to use Jersey to rewrite the previous environment SSH Jersey version 1.19 these days
Use this
<servlet>
<servlet-name>Way REST Service</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>jersey.config.server.provider.packages</param-name>
<param-value>com.bzt.jersey.resources</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Way REST Service</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
error
Warning: Servlet threw load() exception
java.lang.ClassNotFoundException: org.glassfish.jersey.servlet.ServletContainer
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1718)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1569)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:529)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:511)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:139)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1143)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5210)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5493)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Solution:
So it was changed to a com start
<servlet>
<servlet-name>Way 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>com.bzt.jersey.resources</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Way REST Service</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
Similar Posts:
- [Solved] com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes
- [Solved] Spring Error: Artifact spring:war exploded: Error during artifact deployment. See server log for details
- [Solved] Project Start Error: Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError
- Error: there is already ‘RtController’ bean method [How to Solve]
- [How to Solve] Exception starting filter struts2
- How to Solve Struts2 Error: java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils
- [Solved] Error configuring application listener of class [org.springframework.web.util.Log4jConfigListener]
- [Solved] Eclipse Error: java.lang.ClassNotFoundException: ContextLoaderListener
- [Solved] JSP Use MySQL database Error: java.lang.classnotfoundexception: com.mysql.jdbc.driver
- Web Project Error: javax.servlet.ServletException: Circular view path [registerForm]