• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

404 Exception

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi to All.....
Frnds I am creating WEB application in which i am using JSP,Servlet,Bean-Class. I have developed it in Tomcat 4.1.10 but due to some reason it is corrupt and now i have installed Tomcat 4.1.31 .After installed i am facing new problem my servlet is not called .It shows 404 Exception servlet not found .any one please tell me why is this happening .I have checked the spelling and Servlet there is not problem.

My WEB.XML is
---------------------------------------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
<servlet>
<servlet-name>login</servlet-name>
<servlet-class>loginServlet</servlet-class>
<servlet-mapping>
<servlet-name>login</servlet-name>
<url-pattern>servlet/*</url-pattern>
</servlet-mapping>
</servlet>

<security-constraint>
<display-name>Security Constraint</display-name>
<web-resource-collection>
<web-resource-name>USER</web-resource-name>
<url-pattern>/*</url-pattern>
<http-method>DELETE</http-method>
<http-method>GET</http-method>
<http-method>POST</http-method>
<http-method>PUT</http-method>
</web-resource-collection>

<auth-constraint>
<role-name>usr</role-name>
<role-name>adm</role-name>
</auth-constraint>

<user-data-constraint><transport-guarantee>NONE</transport-guarantee></user-data-constraint>
</security-constraint>

<login-config>
<auth-method>FORM</auth-method>
<realm-name>Form-Based Authentication</realm-name>
<form-login-config>
<form-login-page>/index.jsp</form-login-page>
<form-error-page>/Error.jsp</form-error-page>
</form-login-config>
</login-config>

<security-role>
<description>Administrator </description>
<role-name>adm</role-name>
</security-role>

<resource-ref>
<description>Connection</description>
<res-ref-name>jdbc/connection</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

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

</web-app>
--------------------------------------------------------------------
 
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Post some the error message that you are getting.
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi!
specify complete path in servlet-class tag in web.xml
and also check url is also written down correcly or not?

if then after u also have same error plz send me ([email protected]) your class file with web.xm and url those you wirte for access that page in browser
 
Suhani arora
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got the Solution Actually there is need to write each servlet and their URL mapping in web.xml and the way is that

<servlet>
<servlet-name>Login</servlet-name>
<servlet-class>User_Entry</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>Login</servlet-name>
<url-pattern>/servlet/Login</url-pattern>
</servlet-mapping>
 
reply
    Bookmark Topic Watch Topic
  • New Topic