ClassNotFoundException : Com.Sun.Jersey.Spi.Container.Servlet.ServletContainer解决

简介: 版权声明:本文为博主chszs的原创文章,未经博主允许不得转载。 https://blog.csdn.net/chszs/article/details/7876499 用Jersey开发REST服务,项目报一错误:ClassNotFoundException : Com.
版权声明:本文为博主chszs的原创文章,未经博主允许不得转载。 https://blog.csdn.net/chszs/article/details/7876499

用Jersey开发REST服务,项目报一错误:ClassNotFoundException : Com.Sun.Jersey.Spi.Container.Servlet.ServletContainer

详情如下:

org.apache.catalina.core.StandardContext loadOnStartup
严重: Servlet /ecloud threw load() exception
java.lang.ClassNotFoundException: com.sun.jersey.spi.container.servlet.ServletContainer
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1711)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1556)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:532)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:514)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:133)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1136)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1080)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5027)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1100)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1618)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)


原因:项目缺少jersey-bundle.jar包所致。

解决方法:将jersey-bundle-1.13.jar加入到项目类路径下。(说明,Jersey的各个包应使用同一个版本)


目录
相关文章
|
4月前
Caused by: java.lang.ClassNotFoundException: javax.servlet.Filter
Caused by: java.lang.ClassNotFoundException: javax.servlet.Filter
73 3
|
Java
The superclass “javax.servlet.http.HttpServlet“ was not found on the Java Build Path的解决方案
The superclass “javax.servlet.http.HttpServlet“ was not found on the Java Build Path的解决方案
480 0
The superclass “javax.servlet.http.HttpServlet“ was not found on the Java Build Path的解决方案
|
7月前
|
Java
springboot项目出现Exception in thread “main“ java.lang.NoClassDefFoundError: javax/servlet/Filter
springboot项目出现Exception in thread “main“ java.lang.NoClassDefFoundError: javax/servlet/Filter
269 0
|
7月前
|
网络安全
ssh报错java.lang.ClassCastException: com.sun.proxy.$Proxy6 cannot be cast to org.service.impl.EmpServi
ssh报错java.lang.ClassCastException: com.sun.proxy.$Proxy6 cannot be cast to org.service.impl.EmpServi
|
Java Spring
【已解决】Caused by: java.lang.ClassNotFoundException: org.springframework.boot.context.properties.
【已解决】Caused by: java.lang.ClassNotFoundException: org.springframework.boot.context.properties.
3818 1
【已解决】Caused by: java.lang.ClassNotFoundException: org.springframework.boot.context.properties.
|
前端开发 Java Spring
解决Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/Servlet
解决Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/Servlet
393 0
|
Java 数据库连接 API
【Java基础】Java SPI 一 之SPI(Service Provider Interface)进阶& AutoService
【Java基础】Java SPI 一 之SPI(Service Provider Interface)进阶& AutoService
|
Java 应用服务中间件 Apache
The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path类似问题简单解决方案
The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path类似问题简单解决方案
510 0
The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path类似问题简单解决方案
|
Java
Caused by: java.lang.IncompatibleClassChangeError: class net.sf.cglib.core.DebuggingClassWriter has
Caused by: java.lang.IncompatibleClassChangeError: class net.sf.cglib.core.DebuggingClassWriter has
293 0
Caused by: java.lang.IncompatibleClassChangeError: class net.sf.cglib.core.DebuggingClassWriter has
|
Java 应用服务中间件 Apache
JavaWeb:报错信息The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
JavaWeb: 报错信息The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path 好久不写Jsp,今天建立了一个Javaweb工程,并在eclipse中配置了Web容器Tomcat。
2824 0