Requested Resource Not Available (Apache TOMCAT 5.0.28)

I have installed tomcat 5.0.28 and it finds its home page just fine. It also runs the examples just fine. But

any application I add to /webapps I get the 404 Requested Resource not found message. The application consists of one

.jsp file

I am running Win XP sp2

The application is deployed in $CATALINA_HOME/webapps/RequestHeaders

The url is http://localhost:8080/RequestHeaders/request.jsp

I have restarted TOMCAT restarted many times and also deleted the log files.

The jsp (request.jsp) contains the following

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix=c" %>

<html>

<body>

You sent the following request headers:

<br/>

<table border="1">

<tr>

<th>Header</th>

<th>Value</th>

</tr>

<c:forEach var="entry" items="${header}">

<tr>

<td>${entry.key}</td>

<td>${entry.value}</td>

</tr>

</c:forEach>

</table>

</body>

</html>

Any help is highly appreciated.

Thanks

Suraj99

Error message is shown below

HTTP Status 404 - /RequestHeaders/request.jsp

--

type Status report

message /RequestHeaders/request.jsp

description The requested resource (/RequestHeaders/request.jsp) is not available.

--

Apache Tomcat/5.0.28

[1488 byte] By [scshekhara] at [2007-11-27 5:07:36]
# 1
What about the web.xml? Can you post that?
nogoodatcodinga at 2007-7-12 10:26:44 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Contents of web.xml:

<?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 id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd>

<display-name>RequestHeaders</display-name>

</web-app>">

scshekhara at 2007-7-12 10:26:44 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
where did u keep th jsp file...i mean in which folder
santhoshreddythuragaa at 2007-7-12 10:26:44 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
The JSP file request.jsp file is kept in $CATALINA_HOME/webapps/RequestHeaders
scshekhara at 2007-7-12 10:26:44 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
I guess you gotta put it in ROOT.
Nidhuggura at 2007-7-12 10:26:44 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6

> I guess you gotta put it in ROOT.

In $CATALINA_HOME/webapps folder?

Even though I am keeping the JSP file (request.jsp) in a folder (RequestHeaders) under $CATALINA_HOME/webapps, I am using the proper URL (http://localhost:8080/RequestHeaders/request.jsp). I thought it should still work.

In any case I will copy the request.JSP under ROOT and try it.

scshekhara at 2007-7-12 10:26:44 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 7

You shouldn't have to put it in ROOT directory.

The file layout setup that you have detailed thus far seems fine.

Your web.xml file looks wrong though.

You have two definitions in there, for both 2.3 and 2.4

Seeing as you have Tomcat 5, you should remove the <!DOCTYPE > tag which declares the 2.3 Web application, and leave the stuff in the web-app tag which defines it as 2.4.

Hope this helps,

evnafets

evnafetsa at 2007-7-12 10:26:44 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 8

> You shouldn't have to put it in ROOT directory.

> The file layout setup that you have detailed thus far

> seems fine.

>

> Your web.xml file looks wrong though.

> You have two definitions in there, for both 2.3 and

> 2.4

>

> Seeing as you have Tomcat 5, you should remove the

> <!DOCTYPE > tag which declares the 2.3 Web

> application, and leave the stuff in the web-app tag

> which defines it as 2.4.

>

> Hope this helps,

> evnafets

Per your advice I made the changes. I now get the following error :

message.

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application

org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:50)

org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:411)

org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:118)

org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:316)

org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:147)

org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:418)

org.apache.jasper.compiler.Parser.parseDirective(Parser.java:483)

org.apache.jasper.compiler.Parser.parseElements(Parser.java:1539)

org.apache.jasper.compiler.Parser.parse(Parser.java:126)

org.apache.jasper.compiler.ParserController.doParse(ParserController.java:220)

org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)

org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203)

org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)

org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)

org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)

org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

Contents of web.xml:

<?xml version="1.0" encoding="ISO-8859-1"?>

<web-app xmlns="http://java.sun.com/xml/ns/j2ee"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"

version="2.4">

<display-name>RequestHeaders</display-name>

</web-app>

--

Please advice how to make this work.

scshekhara at 2007-7-12 10:26:44 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 9

Ok, well thats progress.

The web app is now starting up correctly, and finding your page. Thats better than the 404 error you had before.

"The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application"

This error message is obviously related to the JSTL tag library you are importing. You are using the JSTL1.1 uri to import the tag library.

Make sure that you have the necessary jars in the WEB-INF/lib directory (standard.jar and jstl.jar) and that they are the correct version of those jars.

If you don't have JSTL, you can download it from http://jakarta.apache.org/site/downloads/downloads_taglibs-standard.cgi

evnafetsa at 2007-7-12 10:26:44 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 10
It worked now. Thanks evnafets for the tip.
scshekhara at 2007-7-12 10:26:44 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...