aspose file tools*
The moose likes Tomcat and the fly likes tomcat error (status code 404) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "tomcat error (status code 404)" Watch "tomcat error (status code 404)" New topic
Author

tomcat error (status code 404)

bhushana rao
Greenhorn

Joined: Jun 02, 2008
Posts: 25
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

Joined: Dec 11, 2004
Posts: 13410

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?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12823
    
    5
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

Joined: Jun 02, 2008
Posts: 25
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

Joined: Jun 02, 2008
Posts: 25
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

Joined: Mar 22, 2000
Posts: 12823
    
    5
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

Joined: Jun 02, 2008
Posts: 25
thanks
jsp program is working

Bhushan
bhushana rao
Greenhorn

Joined: Jun 02, 2008
Posts: 25
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
 
 
subject: tomcat error (status code 404)