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

Posted fengchuisha

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了严重: Servlet threw load() exception java.lang.ClassNotFoundException: org.glassfish.jersey.servlet.Se相关的知识,希望对你有一定的参考价值。

这几天需要使用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.Se的主要内容,如果未能解决你的问题,请参考以下文章

求高手解决严重: Servlet.service() for servlet jsp threw exception java.lang.NullPointerException

Servlet.service() for servlet jsp threw exception

Servlet.service() for servlet jsp threw exception

Servlet.service() for servlet UserServlet threw exception java.lang.NullPointerException 空指针异常

Servlet.service() for servlet [jsp] in context with path [/Healthy_manager] threw exception [Unable

java.lang.IncompatibleClassChangeError