wood burning stoves 2.0*
The moose likes Servlets and the fly likes Error : javax servlet ServletException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Error : javax servlet ServletException" Watch "Error : javax servlet ServletException" New topic
Author

Error : javax servlet ServletException

dale con
Ranch Hand

Joined: Apr 15, 2005
Posts: 93
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="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<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>
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Take the preceding slash out.



Otherwise the browser will at the root of the domain url instead of the root of the contextPath. (http://localhost:8080/ instead of http://localhost:8080/appName/)
[ April 25, 2005: Message edited by: Ben Souther ]

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error : javax servlet ServletException
 
Similar Threads
error in servlet
connection problem from servlet to jdbc
Errror in deploying servlet: wrong name: TestServlet
Servlet running on Local host but throwing Exception on public server
Simple application error