本地主机上没有加载Servlet-api.jar



这个jar没有在我的Tomcat 7本地环境中加载。昨天我关机一天的时候,这个还可以。一切都没有改变,但当我今天早上开始工作时,我看到的是这样的。一切都没有改变——真的。我刚刚打开Eclipse开始工作和测试我的web应用程序-找不到它并返回404。

什么会导致jar无法加载?我在项目中没有错误,并已清理。

错误的jar被定位:

C:UsersmeDocumentsDevEclipseJ2EE_WDT.metadata.pluginsorg.eclipse.wst.server.coretmp1wtpwebappsapp.cloud.servicesWEB-INFlib

清理后的控制台输出:

Apr 25, 2013 9:38:31 AM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/mydomain.com] has started
Apr 25, 2013 9:38:35 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: urn:com:sun:jersey:api:view is already defined
Apr 25, 2013 9:38:35 AM com.sun.jersey.api.core.PackagesResourceConfig init
INFO: Scanning for root resource and provider classes in the packages:
  com.mydomain.webservices
Apr 25, 2013 9:38:35 AM com.sun.jersey.api.core.ScanningResourceConfig logClasses
INFO: Root resource classes found:
  class com.mydomain.webservices.Encryption
  class com.mydomain.webservices.Codec
Apr 25, 2013 9:38:35 AM com.sun.jersey.api.core.ScanningResourceConfig init
INFO: No provider classes found.
Apr 25, 2013 9:38:35 AM com.sun.jersey.server.impl.application.WebApplicationImpl _initiate
INFO: Initiating Jersey application, version 'Jersey: 1.12 02/15/2012 04:51 PM'
Apr 25, 2013 9:38:36 AM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/mydomain.com] is completed
Apr 25, 2013 9:38:36 AM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/cs.core.web] has started
Apr 25, 2013 9:38:36 AM java.util.jar.Attributes read
WARNING: Duplicate name in Manifest: Class-Path.
Ensure that the manifest does not have duplicate entries, and
that blank lines separate individual sections in both your
manifest and in the META-INF/MANIFEST.MF entry in the jar file.
Apr 25, 2013 9:38:36 AM java.util.jar.Attributes read
WARNING: Duplicate name in Manifest: Class-Path.
Ensure that the manifest does not have duplicate entries, and
that blank lines separate individual sections in both your
manifest and in the META-INF/MANIFEST.MF entry in the jar file.
Apr 25, 2013 9:38:36 AM java.util.jar.Attributes read
WARNING: Duplicate name in Manifest: Class-Path.
Ensure that the manifest does not have duplicate entries, and
that blank lines separate individual sections in both your
manifest and in the META-INF/MANIFEST.MF entry in the jar file.
Apr 25, 2013 9:38:36 AM java.util.jar.Attributes read
WARNING: Duplicate name in Manifest: Class-Path.
Ensure that the manifest does not have duplicate entries, and
that blank lines separate individual sections in both your
manifest and in the META-INF/MANIFEST.MF entry in the jar file.
Apr 25, 2013 9:38:36 AM java.util.jar.Attributes read
WARNING: Duplicate name in Manifest: Class-Path.
Ensure that the manifest does not have duplicate entries, and
that blank lines separate individual sections in both your
manifest and in the META-INF/MANIFEST.MF entry in the jar file.
Apr 25, 2013 9:38:40 AM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/cs.core.web] is completed
Apr 25, 2013 9:38:40 AM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/app.cloud.services] has started
Apr 25, 2013 9:38:41 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(C:UsersmeDocumentsDevEclipseJ2EE_WDT.metadata.pluginsorg.eclipse.wst.server.coretmp1wtpwebappsapp.cloud.servicesWEB-INFlibel-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/el/Expression.class
Apr 25, 2013 9:38:41 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(C:UsersmeDocumentsDevEclipseJ2EE_WDT.metadata.pluginsorg.eclipse.wst.server.coretmp1wtpwebappsapp.cloud.servicesWEB-INFlibservlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Apr 25, 2013 9:38:45 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: urn:com:sun:jersey:api:view is already defined
Apr 25, 2013 9:38:45 AM com.sun.jersey.api.core.PackagesResourceConfig init
INFO: Scanning for root resource and provider classes in the packages:
  com.app.api
Apr 25, 2013 9:38:45 AM com.sun.jersey.api.core.ScanningResourceConfig logClasses
INFO: Root resource classes found:
  class com.app.api.SyncAccount
  class com.app.api.Override
  class com.app.api.SyncSchedule
  class com.app.api.SyncDevice
  class com.app.api.Register_NOTUSED
  class com.app.api.Mock
  class com.app.api.Contact
  class com.app.api.WSInit
  class com.app.api.SyncMetrics
Apr 25, 2013 9:38:45 AM com.sun.jersey.api.core.ScanningResourceConfig init
INFO: No provider classes found.
Apr 25, 2013 9:38:45 AM com.sun.jersey.server.impl.application.WebApplicationImpl _initiate
INFO: Initiating Jersey application, version 'Jersey: 1.12 02/15/2012 04:51 PM'
Apr 25, 2013 9:38:45 AM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/app.cloud.services] is completed

编辑

我要做的是启动我的web应用程序,目前无法找到,因为jar没有加载。它就在它应该在的地方——昨天还可以,但今天早上不行了。

servlet-api.jar是从tomcat_home/lib目录加载的。我可以建议您清理tomcat服务器并重新启动它。要清理tomcat,您需要执行"窗口->显示视图->其他->服务器",您将能够看到tomcat服务器。右键点击"Clean…"。希望这应该解决您的问题,因为它昨天工作正常,今天突然不工作,没有任何变化。

最新更新