I have a servlet in a jar file which I want to deploy to my Tomcat 6 instance. I did the following things:
- added a servlet declaration in my root web.xml
- added a servlet-mapping in the root web.xml
- put my jar file in /tomcat/lib
- re-started my server
I am getting the following error when I direct to my servlet
javax.servlet.ServletException: Wrapper cannot find servlet class com.mypackage.myServlet or a class it depends on
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
java.lang.Thread.run(Unknown Source)
root cause
java.lang.ClassNotFoundException: com.mypackage.myServlet
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1516)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
java.lang.Thread.run(Unknown Source)
This says to me that my web.xml is configured correctly and I am successfully hitting the right URL pattern. So the question is... where do I put a servlet jar file in Tomcat 6 so it gets picked up in the CLASSPATH?
TIA