I seem to be having the same problem that everyone has with Struts2 and getting it up and running, driving me mad :@
Having manually written the files from the Hello_World_Struts2_Ant project and run into build path issues, I decided I should just download the project to see it up and running…..
For some reason the only page I can access from this project is index.jsp, when i try to click on the link for hello.action or visit hello.action through the address bar, it gives me a tomcat 404. (I am running tomcat 7).
I would usually concede that it is my own idiocy that has led me here, but the fact that the project download from the struts site isn’t working is just plain annoying…..
I’m not great with tomcat error logs, but I can’t see anything that can help me with this issue.
Any help would be greatly appreciated.
To save me loading this page with all code that I have, I’ve got the code that is distributed here: http://code.google.com/p/struts2-examples/downloads/detail?name=Hello_World_Struts_2_Ant_2_3_1_2.zip&can=2&q=
Catalina Log
=====================================
INFO: Server startup in 3099 ms
08-Aug-2012 22:28:39 org.apache.jasper.compiler.TldLocationsCache tldScanJar
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them.
Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
08-Aug-2012 22:28:46 org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-8080"]
08-Aug-2012 22:28:46 org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["ajp-bio-8009"]
08-Aug-2012 22:28:46 org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
08-Aug-2012 22:28:46 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/Hello_World_Struts2_Ant] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@39bde3d2]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@61b80d9b]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
08-Aug-2012 22:28:46 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/Hello_World_Struts2_Ant] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@39bde3d2]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@7a856d3b]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
08-Aug-2012 22:28:46 org.apache.coyote.AbstractProtocol stop
stderr Log (INFOS Removed)
================================
08-Aug-2012 22:28:46 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/Hello_World_Struts2_Ant] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@39bde3d2]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@61b80d9b]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
08-Aug-2012 22:28:46 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/Hello_World_Struts2_Ant] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@39bde3d2]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@7a856d3b]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
08-Aug-2012 22:28:46 org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-bio-8080"]
08-Aug-2012 22:28:46 org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["ajp-bio-8009"]
After a reading the above posts I deleted my Tomcat installation and started again from scratch that way, it seemed that Tomcat had been the problem as it worked straight away for me after reinstalling tomcat.
It had perhaps been me deploying things as root.war that caused the tomcat issue.
The “same problem” thing was that I had done a bit of search before posting this and found a lot of folk having issues with getting struts up and running, perhaps a poor phrase to describe the issue on my part.
Thanks for the help though! Defainately going to look into Maven as a lot of folk seem to recommend it, although the copying to WEB-INF/lib and configuring build path works for now 🙂