• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

There is no Action mapped for namespace / and action name . - [unknown location]

 
maggie karve
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am a newbie in Struts 2...
i am trying to execute a Login.jsp and i am using eclipse as the development environment....i have stored the struts.xml in ApplicationResources.properties file......

but when i run the program i get....

There is no Action mapped for namespace / and action name . - [unknown location]
...
i went through previous links in javaranch which had same posts but even though i made changes like puttings struts.xml under WeB-InF dirrectory and all...my problem is not getting solved...thanks...
 
Sam Rakshit
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
maggie joseph wrote:Hi,
I am a newbie in Struts 2...
i am trying to execute a Login.jsp and i am using eclipse as the development environment....i have stored the struts.xml in ApplicationResources.properties file......

but when i run the program i get....

There is no Action mapped for namespace / and action name . - [unknown location]
...
i went through previous links in javaranch which had same posts but even though i made changes like puttings struts.xml under WeB-InF dirrectory and all...my problem is not getting solved...thanks...


Try creating an action in struts which would have a result entry like :

<action name="start">
<result>/login.jsp</result>
</action>

Then try to direct your website to this location : http://localhost:8080/start

That should work if you are in Tomcat (change the port accordingly)

To make it the default page, make an entry of the /start in the <welcome-file-list> in web.xml

hope that helps!!!

 
Ankit Garg
Sheriff
Posts: 9529
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have stored the struts.xml in ApplicationResources.properties file......

You've placed your xml file in a properties file?? The struts.xml is supposed to go into the WEB-INF/classes directory. So you should put it in the root of your source folder in your eclipse project (the place where any classes with no package goes). After that you need to show us some code, what does your struts.xml look like, your Action class' code, what URL are you entering in the browser??
 
maggie karve
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am just tying to execute an example from the tutorial available in this link..my code is the same as

http://java.dzone.com/articles/struts2-tutorial-part-27

i have placed my files in eclipse as mentioned in the tutorial.....
still i have getting error.....i have placed the same struts.xml file under WEB-INF/classes folder..........
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Turn devMode on, set the log level to DEBUG, and check the startup logs; we'll go from there. Also post the config and deployed directory tree.
 
maggie karve
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi...this is what i get when i put devmode on..



I am using Struts 2.1.8.1.....

and my directory for strut.xml is
C:\Software\Tomcat 6.0\webapps\testapp\WEB-INF\classes\struts.xml and rest all the files i have made are in the same path as mentioned in the tutorial....i have put the jsp files Login.jsp and Welcome.jsp in C:\Software\Tomcat 6.0\webapps\testapp directory.....i even made the same jsp and deployed it in eclipse under

C:\Software\workspace\StrutsHelloWorld\WebContent folder......

is there anything else that i am missing???
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:Turn devMode on, set the log level to DEBUG, and check the startup logs; we'll go from there. Also post the config and deployed directory tree.
 
maggie karve
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting error while starting Tomcat...

i set the devmode on by including struts.properties file



and struts.xml file

when i started Tomcat i am getting the foll...
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll need to satisfy the missing dependencies before proceeding.
 
M Turner
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maggie,

Although the IDE puts a copy of struts.xml in your WEB-INF/classes folder when it builds your project. You will need to have a copy in your /src folder. Mine is in the root of my Java Resources/src folder.

Also, my IDE blows up when in "dev mode" - I don't recommend it.

Good luck,
Marcella
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The issue is with the missing dependencies, as the stack trace states.

If your IDE "blows up" with devMode on then something is wrong with your IDE setup; I run in devMode during development under several IDEs without issue.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic