0

我正在使用 Eclipse INDIGO、Apache-tomcat-7.0.42 和 jersay 库。我将我的项目作为战争导出到 \apache-tomcat-7.0.42\webapps 文件夹并从 cmd 运行服务器,它不会引发任何异常。但是当我尝试在服务器上运行我的项目时,它给出了以下异常

Aug 10, 2013 11:29:48 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.42
Aug 10, 2013 11:29:48 PM org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet Jersey-Servlet as unavailable
Aug 10, 2013 11:29:48 PM org.apache.catalina.core.StandardContext loadOnStartup
: Servlet /sc threw load() exception
java.lang.ClassNotFoundException: com.sun.jersey.spi.container.servlet.ServletContainer
at            .apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:527)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:509)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:137)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1144)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5176)
at    org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5460)
   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$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

当我在网络上搜索我的错误时,我在球衣库中发现了一些问题。但我找不到任何解决方案。我添加了这个库。但它给出了同样的错误。

jersey-servlet-1.13-b01.jar

jersey-servlet-1.17.1.jar

jersey-bundle-1.17.1.jar

请帮我....

4

1 回答 1

0

你需要添加 jersey-core.jar

查看mykyong.com 相同的问题解决方案

于 2013-08-10T19:58:17.773 回答