码迷,mamicode.com
首页 > 编程语言 > 详细

严重: Servlet threw load() exception java.lang.ClassNotFoundException: org.glassfish.jersey.servlet.ServletContainer

时间:2018-07-26 15:15:06      阅读:1461      评论:0      收藏:0      [点我收藏+]

标签:run   def   环境   OLE   mapping   解决   解决办法   lifecycle   init   

这几天需要使用jersey来改写以前的 环境ssh     jersey版本 1.19

使用这种 

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

 

报错了

严重: 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)

后来在网上找了找各种说法都有,唯独没有解决办法,于是乎就看了一眼jar包相关,没有此路径。

 

最后找到了 

技术分享图片

 

于是乎就换成了com 开头的

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

 

严重: Servlet threw load() exception java.lang.ClassNotFoundException: org.glassfish.jersey.servlet.ServletContainer

标签:run   def   环境   OLE   mapping   解决   解决办法   lifecycle   init   

原文地址:https://www.cnblogs.com/fengchuisha/p/9370990.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!