0

Hi,
I have created a Hello servlet , compiled it and deployed the Hello.class in the folder C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\test\WEB-INF\classes manually. In the C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\test\WEB-INF folder i have created a web.xml like:

<web-app xmlns="http://java.sun.com/xml/ns/j2ee" version="2.4"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http:/java.sun.com/dtd/web-app_2_3.dtd">
<servlet>
<servlet-name>Hello</servlet-name>
<servlet-class>test.Hello</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Hello</servlet-name>
<url-pattern>/Hello</url-pattern>
</servlet-mapping>
</web-app>

In the server.xml I have modified the port from 8080 to 8081.
Now i run this from IE using the URL http://localhost:8081/test/Hello
But I m getting the error


HTTP Status 404 - Servlet Hello is not available

--------------------------------------------------------------------------------

type Status report

message Servlet Hello is not available

description The requested resource (Servlet Hello is not available) is not available.

Please help me in resolving this error.. I have been trying to find a solution from past 3 days but dint work out.
I was able to run the same servlet last week on the same machine. But now this problem has occured. Please Help..!!!

Thanks

Edited by peter_budo: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by ~s.o.s~
0

Do you get any errors when starting the container? Also, you need to place the class file in a location which matches your package structure. Your test.Hello.class file should be placed in the 'test' folder in the classes directory.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.