Saturday, April 23, 2011

Error on browser:
HTTP Status 404 - There is no Action mapped for namespace / and action name .......


Error Log:
WARNING: Could not find action or result
There is no Action mapped for namespace / and action name doLogin. - [unknown location]
at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:177)
===============================================
Dev environment:
App type: Web app,
IDE: Eclipse,
Server: Tomcat runtime location referenced in eclipse, start / stop from within eclipse
Framework: Struts 2.2.1.1
OS: Ubuntu Linux
System: Dual core.

Cause:
Either struts.xml file is missing or not available in classpath.

Solution: 1 of 2
- Create or move your struts.xml to your src folder as a sibling of root package.
- Rebuild app and restart tomcat if hot deploy is turned off.

Solution: 2 of 2
- Create a folder named "classes" under WEB-INF in eclipse IDE - "WebContent/WEB-INF/classes".
- Move the struts.xml into classes folder.
- Rebuild app and restart tomcat if hot deploy is turned off.