aspose file tools*
The moose likes Struts and the fly likes Struts 2 error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 error" Watch "Struts 2 error" New topic
Author

Struts 2 error

Sidd Kulk
Ranch Hand

Joined: Feb 20, 2007
Posts: 152
This is my struts config file: The root of my project is StrutsProject:



I am trying to access the following URL: http://localhost:8080/StrutsProject/helloworld/HelloWorld.action

I am getting the following error:

There is no Action mapped for action name helloworld. - [unknown location] at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186) at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:497) at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:421) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)

Please help,
Siddharth
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9280
    
  17

Where did you put your struts.xml file??


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Are you also returning the literal string "SUCCESS" from the action? That's *not* what the SUCCESS constant is defined as.

I'm also a little suspicious of the mis-match between the URL you're requesting and the error message.
Sidd Kulk
Ranch Hand

Joined: Feb 20, 2007
Posts: 152
I have put my struts.xml file in src, and it is copied when the project is built into WEB-INF classes.

And I am returning the string "SUCCESS" from action class.

Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9280
    
  17

Does your URL contain HelloWorld.action or helloworld.action??
Sidd Kulk
Ranch Hand

Joined: Feb 20, 2007
Posts: 152
My URL has HelloWorld.action, as mentioned above. I see no reason why this should not work.

Please help.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

What does the config-browser plugin report? Have yo uturned devMode to true and turned up logging to check for startup errors?
Sidd Kulk
Ranch Hand

Joined: Feb 20, 2007
Posts: 152
Yes, dev mode is set to true and logs are visible on console. I had few errors earlier, but I resolved them all to start the server. There are no errors now.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

David Newton wrote:What does the config-browser plugin report?
Sidd Kulk
Ranch Hand

Joined: Feb 20, 2007
Posts: 152
Sorry David, I didn't get that part. What is config-browser plugin? I am not using any such plugin.
Vijay Oruganty
Greenhorn

Joined: Sep 08, 2005
Posts: 3
>And I am returning the string "SUCCESS" from action class.
Not sure if you meant the constant SUCCESS from com.opensymphony.xwork2.Action which actually is the string "success". So if you are returning the actual string it should be "success".
Sidd Kulk
Ranch Hand

Joined: Feb 20, 2007
Posts: 152
That is correct Vijay, I am returning the hard coded String "SUCCESS"
The problem is that the code is not reaching the action class at all
Pradeep Adibatla
Ranch Hand

Joined: Oct 27, 2009
Posts: 336
I think your jsp <s:form action="helloworld" and the one in your config.xml is "Helloworld"...check that !!!
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Sidd Kulk wrote:Sorry David, I didn't get that part. What is config-browser plugin? I am not using any such plugin.

I'm suggesting you should, to see what S2 things your configuration is.
Sidd Kulk
Ranch Hand

Joined: Feb 20, 2007
Posts: 152
I guess I will download it and give it a try..

Anyone here know of some bug related to Tomcat 5 and Struts 2?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Download it? It comes with the Struts 2 distribution.

And no, I don't. The problem is not going to be related to S2 or Tomcat--it's going to be a configuration or deployment issue.

I'm *still* suspicious of the error message--the action name shouldn't be "helloworld", it should be "HelloWorld". That's why I wanted you to check what S2 thinks your configuration is.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts 2 error
 
Similar Threads
Problems with HelloWorld Struts 2
Struts2 namespace url problem
Struts2 Action problem Problem
requested resource (/tutorial/HellwWorld.action) is not available error
problem in struts 2