user3845008
user3845008

Reputation: 1

HTTP Status 500 wrapper can not find servlet class

I have created simple dynamic web project on eclipse. I am trying to submit the html form and passing the request to servlet. When I click on submit i get this exception:

HTTP Status 500 wrapper can not find servlet class com.tcs.navigator.Servlet.labServlet or a class it depends on

in jsp form actoin tag I had given same action path as per web xml which is :

action = "labServlet"

content of web.xml is :

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">

  <welcome-file-list>
    <welcome-file>home.jsp</welcome-file>

  </welcome-file-list>
  <servlet>
    <description>To Upload Files for processing</description>
    <display-name>labServlet</display-name>
    <servlet-name>labServlet</servlet-name>
    <servlet-class>com.tcs.navigator.Servlet.labServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>labServlet</servlet-name>             
    <url-pattern>/labServlet</url-pattern>  
  </servlet-mapping>

</web-app>              

I tried following workarounds:

  1. clean tomcat directory
  2. open/close project
  3. clean projects
  4. restart eclipse
  5. Verifying class path
  6. created new dynamic web project with same code

But still the same exception persist.

all libraries like servlet-api.jar are present in build path.

Upvotes: 0

Views: 588

Answers (1)

faisalbhagat
faisalbhagat

Reputation: 2160

you have kept capital S in "Servlet.labServlet" . system is getting it as a Class named Servlet. name your servlet starting with caps like "LabServlet" in the code and start all your package name with small letters. so your complete class path should be

com.tcs.navigator.servlets.LabServlet

Upvotes: 1

Related Questions