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.

12 comments:

  1. excellent .. It worked finally

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. Struts Problem Report

    Struts has detected an unhandled exception:
    Messages:
    There is no Action mapped for namespace / and action name .

    This is show in netbeans 7.2

    ReplyDelete
  4. after doing whatever u have told to do ....but still is showing error...

    ReplyDelete
  5. Thanks a lot . It worked for me too. Was stuck with this problem for days.

    ReplyDelete
  6. Excellent answer, struts.xml should be inside the classes folder

    ReplyDelete