Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error encountered by tomcat

Status
Not open for further replies.

plork123

Programmer
Mar 8, 2004
121
GB
Hello

I'm trying to call a simple servlet from an html page and get this error from tomcat. Can anyone tell me how to solve it

Many Thanks



exception

javax.servlet.ServletException: Wrapper cannot find servlet class simple.servlet.SimpleServlet2 or a class it depends on
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:793)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:702)
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:571)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:644)
java.lang.Thread.run(Thread.java:534)


root cause

java.lang.ClassNotFoundException: simple.servlet.SimpleServlet2
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1340)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:793)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:702)
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:571)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:644)
java.lang.Thread.run(Thread.java:534)



this is my web.xml file


<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns=" xmlns:xsi=" xsi:schemaLocation=" <display-name>SimpleTest</display-name>
<servlet>
<description/>
<display-name>SimpleServlet2</display-name>
<servlet-name>SimpleServlet2</servlet-name>
<servlet-class>simple.servlet.SimpleServlet2</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>SimpleServlet2</servlet-name>
<url-pattern>/SimpleServlet2</url-pattern>
</servlet-mapping>

<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>


my html page

<html>

<body>
<form action=/SimpleServlet2 method=post>
<table>
<tr>
<td>
<center><input type=submit value="GO"></center>
</td>
</tr>
</table>
</form>
</body>

</html>
 
Where have you put the SimpleServlet2.class file, and is it in a package named "simple.servlet" ?

--------------------------------------------------
Free Database Connection Pooling Software
 


It's alright. i've sorted it.

In my html file i had this <form action=/SimpleServlet method=post>


Changed it to this

<form action="SimpleServlet" method=post>

and it worked !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top