1

This jar in not loading in my Tomcat 7 environment locally. This worked fine yesterday when I shut down for the day. Nothing has changed, but when I start this morning this is what I am presented with. Nothing has changed - really. I just opened up Eclipse to start working and testing my web app - which cannot be found and returns a 404.

What would cause a jar not to load? I have no errors in the project and have cleaned it.

The offending jar is located:

C:\Users\me\Documents\Dev\Eclipse\J2EE_WDT\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\app.cloud.services\WEB-INF\lib

The Console output after cleaning:

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:\Users\me\Documents\Dev\Eclipse\J2EE_WDT\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\app.cloud.services\WEB-INF\lib\el-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:\Users\me\Documents\Dev\Eclipse\J2EE_WDT\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\app.cloud.services\WEB-INF\lib\servlet-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

EDIT

What I am trying to do is start my web app, which currently cannot be found because the jar is not loading. It's physically where it should be - again this worked yesterday and now as of this morning is not.

Roy Hinkley
  • 10,111
  • 21
  • 80
  • 120
  • Where is the jar located? How are you adding it to your classpath? – Sotirios Delimanolis Apr 25 '13 at 14:38
  • @SotiriosDelimanolis is the *servlet-api.jar*. Looks like OP isn't running Tomcat or the Tomcat installation got corrupted somehow. – Luiggi Mendoza Apr 25 '13 at 14:42
  • Please, let us now what exactly you're trying to do and where (which application) you're getting the error along with the error message/details. Are you getting a 404 when accessing your web application in the browser or your Eclipse is unable to find the jar or both? – Ravi K Thapliyal Apr 25 '13 at 14:42
  • @LuiggiMendoza I believe the problem is that he has the `servlet-api.jar` in his apps' `/lib` folder, but Tomcat already has that jar in its own lib. – Sotirios Delimanolis Apr 25 '13 at 14:45
  • It is in both locations - the Tomcat 7 folder and the Eclipse tomcat folder. – Roy Hinkley Apr 25 '13 at 14:46
  • @AndroidAddict What is eclipse tomcat folder? Do you mean your WEB-INF/lib? Remove it from there. Take a look: http://stackoverflow.com/questions/1993493/error-servlet-jar-not-loaded – Sotirios Delimanolis Apr 25 '13 at 14:47
  • 1
    @SotiriosDelimanolis this means OP is deploying the tomcat apps in the workspace folder (yes, a bad unknown habit for starters). OP should try to deploy the app in the tomcat folder and drop this *servlet-api.jar* from *WEB-INF/lib*. – Luiggi Mendoza Apr 25 '13 at 14:49
  • The Eclipse tomcat folder is the first code snippet above. – Roy Hinkley Apr 25 '13 at 14:49
  • That folder is metadata. If you remove it from your project, it will be removed from there automatically when you try to build it with eclipse. – Sotirios Delimanolis Apr 25 '13 at 14:50
  • 1
    Do as Luiggi Mendoza said. Tomcat is throwing an error because you're trying to load servlet-api.jar twice (again from your WEB-INF/lib folder) when it's already available with Tomcat. – Ravi K Thapliyal Apr 25 '13 at 14:59
  • Okay, I removed the servlet-api.jar and the el-api.jar. No more jar not loaded errors. Servlets now work but my jsp files still return 404. Obviously that's a different issue. – Roy Hinkley Apr 25 '13 at 15:23
  • How are you accessing your web app - from within eclipse (doing Run As..) or from a stand-alone web browser instance? Also, do you have a Tomcat instance configured in Eclipse i.e. do you start/stop and deploy your apps from there? – Ravi K Thapliyal Apr 25 '13 at 15:39
  • @Ravi I have tomcat configure in Eclipse - start and stop from the servers tab. When I try to run my web pages I right-click on the jsp file and select run and the Tomcat instance that is running. That loads the page in Chrome. However, as of this morning I only get a 404 for any of the web pages. – Roy Hinkley Apr 25 '13 at 15:45
  • @LuiggiMendoza where do you recommend deploying other than workspace folder? On a related note, I am unable to change the deployment location when I double-click the server - server location selections are read-only. – Roy Hinkley Apr 25 '13 at 21:44
  • You must deploy the web applications on the respective web application server deploy folder. For Tomcat 7, this will be the *webapps* folder. – Luiggi Mendoza Apr 25 '13 at 21:56
  • Roger that. In this instance though I am running the dev server locally and Eclipse does not give me an option to deploy to any other location. If I build a war file I absolutely deploy to respective tomcat location. Are we on the same page? – Roy Hinkley Apr 25 '13 at 21:59
  • Yes. By the way, I've noticed my Tomcat vX server overview doesn't let me change the server location (as you said in a previous comment). Refer to [eclipse server locations disabled and need to change to use tomcat installation](http://stackoverflow.com/q/1012378/1065197) to solve this problem. – Luiggi Mendoza Apr 25 '13 at 22:04
  • Thank you. I will use the Tomcat tools to change the dev location and not try to do it through Eclipse. Appreciate the tip! – Roy Hinkley Apr 25 '13 at 22:07

1 Answers1

1

servlet-api.jar is loaded from tomcat_home/lib directory. I can suggest you to clean tomcat server and restart it. To clean tomcat you need to do "Window -> Show View -> Other -> Servers" and you'll be able to see the tomcat server. Right click and hit "Clean...". Hope this should resolve your problem as it was working fine yesterday and suddenly not working today without any change.

Amitabha Roy
  • 769
  • 5
  • 8
  • Already have the servers view in my perspective. But thanks for the advice on cleaning the tomcat working directory. – Roy Hinkley Apr 25 '13 at 15:24
  • I noticed that the working directory was missing all of my jsp files as well as folders for styles and javascript files. When I manually copied them into the working directory all my web pages work again. Not sure why they did not get deployed (why deleted) though. – Roy Hinkley Apr 25 '13 at 16:10