struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Eclipse WTP/Tomcat/Struts 2 - 404 error
Date Fri, 06 Apr 2007 21:19:02 GMT
Hi all

This might sound off topic, but I had already posted this in Eclipse WTP 
newsgroup, but couldn't resolve it yet. So I thought someone here might 
have already faced this problem.

I configured Eclipse WTP for a struts-enabled web application. When I ran 
my application using "run on server" option, it gives a 404 error.

Below is my configuration:
Java - 1.4.2_13
Tomcat 5.5.23 with Java 1.4 compatible jars
Struts 2.0.6 with Java 1.4 compatible jars
Eclipse WTP 3.2.2

I created a new "dynamic web project" with Tomcat 5.5 as runtime, "r5sis" 
as "context root" and "WebContent" as "Content Directory". I copied the 
struts jars to the "WebContent/WEB-INF/lib" folder. The jsp files are 
placed in "WebContent/WEB-INF/jsp" folder.

Find below my struts.xml and web.xml

<?xml version="1.0" encoding="UTF-8"?>
   <!-- Include Struts 2 default (from Struts 2 JAR). -->
   <include file="struts-default.xml"/>

   <!-- Configuration for the default package. -->
   <package name="default" extends="struts-default">

       <!-- Default interceptor stack. -->
       <action name="login" 
class="gov.epa.r5sis.struts.action.LoginAction" >
          <result name="success" 
          <result name="error" 

      <action name="logout2" 
class="gov.epa.r5sis.struts.action.LoginAction" method="logout" >
          <result name="success" 

      <action name="logout" 
class="gov.epa.r5sis.struts.action.LogoutAction" >
          <result name="success" 


<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="" xmlns:xsi="" xsi:schemaLocation="">

When I run the application by using "run on server" option, the tomcat 
server starts without a problem and opens the url "http://localhost
:8080/r5sis/" in the browser.

It gives a 404 error, saying "The requested resource (/r5sis/) is not 
available." "r5sis" is my project name. Also the project is placed only in 
the eclipse workspace and not in the "<tomcat dir>/webapps" folder. Even 
"localhost:8080/index.jsp" gives a 404 error. 

When I tried running Tomcat from the command prompt, it runs properly and 
"localhost:8080/index.jsp" works fine.So the Tomcat is not working fine 
inside Eclipse WTP. Please let me know what went wrong.

A member in eclipse mailing list suggest to place the welcome file in the 
"WebContent" folder and try. So I just created a "index.htm" file with 
just "Hello world!", in the "WebContent" folder and modified the web.xml 


But still it is not working, please help!


Vignesh Manickam Periaswamy
Web Application Developer Intern, Information Management Section
WPTD,   EPA Region 5         312-886-0887

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message