• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

tomcat error (status code 404)

 
bhushana rao
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am using tomcat 5.5

i deployed application /first in tomcat
it is deployed and shows running in tomcatmanager

but when i am accessing /first
it gives status 404 request resource is not available

please any body suggest me

Bhushan
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you describe how you've deployed it?
Where did you put each file?
What URL are you using when you try to access it?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe that "running" in the manager does not imply that the servlet instance has been created and init()ed.

This result is what I would expect if creation and init() failed. Hopefully the log files will tell more.

Bill
 
bhushana rao
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i created a folder named first in tomcat webapps

inside first i created WEB-INF

in WEB-INF i created classes folder in this folder i placed one servlet class
in WEB-INF i copied web.xml from examples given
then i started tomcat

i opened tomcat manager
i is showing /first i clicked that but it gives
status 404 requested resource is not found

Bhushan
 
bhushana rao
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have installed tomcat 6

set JAVA_HOME variable to jdk directory
i have included
servlet-api.jar
jsp-api.jar in classpath

servlets are working
but jsp are not working
is there any additional setting path required
please suggest me

if i accessing my web application named /first it is displaying status code 404
but when i used with servlet alias name it is working
what is differrence
Bhushan
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
f i accessing my web application named /first it is displaying status code 404
but when i used with servlet alias name it is working


If I am following your situation properly, Tomcat would be looking for an index.html file in the /first/ directory, not a servlet. See the definition of welcome-file names in the default web.xml for names Tomcat will look for. Defaults are index.html, index.htm and index.jsp.

Bill
 
bhushana rao
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks
jsp program is working

Bhushan
 
bhushana rao
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have created applcation ErrorDemo
which contains
AuthenticatCustomer.jsp LoginErrorPage.jsp and LoginPage.htm
i am retrieving parameters from htm page and parse the loginid to int
when NumberFormatException occurs it will go to LoginErrorPage.jsp
but it displays can not find server

i mentioned ErrorPage="LoginErrorPage.jsp" in AuthenticatCustomer.jsp
and i have mentioned isErrorPage=true in LoginErroPage.jsp
in web.xml i have write like this

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Errordemo</display-name>
<welcome-file-list>
<welcome-file>/LoginPage.htm</welcome-file>
</welcome-file-list>
<error-page>
<exception-type>java.lang.NumberFormatException</exception-type>
<location>/LoginPage.htm</location>
</error-page>
<jsp-config/>
</web-app>
but it is displaying
cannot find server when NumberFormatException was occured

please suggest me
Bhushan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic