I'm running Tomcat 5.5.17 in Linux enivronment and have deployed a webapp in a directory (myapp). I've set servlet mappings in web.xml and re-checked that they are correct.
When I browse to myapp/index.jsp, it shows up correctly. However, when I continue using the servlet and the servlet tries to access myapp/measurements (defined in web.xml), I get the following error:
javax.servlet.ServletException: Class org.myapp.measureIt is not a Servlet org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199) org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282) org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:754) org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:684) org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:876) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)java.lang.Thread.run(Thread.java:595)
INFO: Marking servlet measurements as unavailable 5.10.2006 9:53:53 org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Allocate exception for servlet measurements 5.10.2006 9:53:54 org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Allocate exception for servlet HTMLManager java.lang.NoSuchMethodError: javax.servlet.ServletConfig.getServletName()Ljava/lang/String; at org.apache.catalina.manager.ManagerServlet.init(ManagerServlet.java:447) at javax.servlet.GenericServlet.init(GenericServlet.java:172) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:757) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:130) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595)
The same happens with each and every one of the classes.
When I recompile the java files, it passes without errors, but I get the following warnings:
Does that have something to do with the errors? my custom servlets extend those javax.servlet classes.
I'd be extremely grateful for any help, am kind of a newbie with Tomcat and have been struggling with this for days now.
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12267
1
posted
0
Thats odd alright. The following questions occur to me: 1. What version(s) of Java exist on this machine? 2. Have earlier Tomcat versions been running on this machine? 3. Are you sure the compiler is using the installed Tomcat servlet api jar?
Bill That setStatus( int, String ) usage was deprecated in version 2.1 - thats pretty old, where did the code come from?
Originally posted by William Brogden: Thats odd alright. The following questions occur to me: 1. What version(s) of Java exist on this machine? 2. Have earlier Tomcat versions been running on this machine? 3. Are you sure the compiler is using the installed Tomcat servlet api jar?
Bill
Thanks for the suggestions, they were right on. The problems were conflicting references to JDK (1.5.0_01 vs. 1.5.0_06) and CLASSPATH problems (there were duplicates and servlet-api.jar and jsp-api.jar were both missing). Now it's working fine.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: Tomcat 5.5.17 problems - class not a servlet