coolbuddy (1) [Avatar] Offline
#1
hi all,
i am new to struts 2 , i have created a sample helloworld application successfully. but i tried to launch new application for login module . i have created and deployed successfully. after i get the login page i gave username and password , and clicked login button, i got the following error message in Tomcat 6,

i have my package structure as follows

-src
--com.sample.action
---LoginAction.java
--Struts.xml
--web
---view
----login.jsp
----error.jsp
----success.jsp
---WEB-INF
---web.xml
---lib
---classes


following are the error i got in tomcat...

Aug 5, 2009 4:46:12 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
WARNING: No configuration found for the specified action: '/doLogin' in namespace: '/view'. Form action defaulting to 'action' attribute's literal value.
Aug 5, 2009 4:46:13 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
WARNING: No configuration found for the specified action: '/doLogin' in namespace: '/view'. Form action defaulting to 'action' attribute's literal value.
Aug 5, 2009 4:46:19 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
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)
at org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)
at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)
at com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:47)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:45smilie
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:12smilie
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
chad.davis (234) [Avatar] Offline
#2
Re: There is no Action mapped for namespace / and action name in struts 2
The error message is telling you that the action your URL is targetting doesn't exist in the mapping. So, we need to see your XML configuration.
chad.davis (234) [Avatar] Offline
#3
Re: There is no Action mapped for namespace / and action name in struts 2
Also, where is this HelloWorld app from? The book? Did you make it? Please try to post more specific information when you have a question.
barvaliya (1) [Avatar] Offline
#4
Re: There is no Action mapped for namespace / and action name in struts 2
i work in netbeans 6.0

i got the same error like
message--------There is no Action mapped for namespace / and action name login.
description-------The requested resource (There is no Action mapped for namespace / and action name login.) is not available.

my code for two mape file is here
login.jsp file
<s:form action="login" method="post">
and
struts.xml
<package name="hello" extends="struts-default" namespace="/hello">

<action name="login" class="hello.LoginAction">
<result name="success">/login_success.jsp</result>
<result name="error">/login.jsp</result>
<result name="input">/login.jsp</result>
</action>
</package>
so give me any help please for struts 2
oetzi (54) [Avatar] Offline
#5
Re: There is no Action mapped for namespace / and action name in struts 2
Hello barvaliya,

Your linking is faulty.

The error message tells you
"no Action mapped for namespace / and action name login"
The useful information is here: "namespace /" which means that you did not specify the namespace within your link.

But in your struts.xml you are using a namespace <-> package "<package name="hello..." >

So your link must look something like this:
".../hello/login.action"

Greetings
oetzi
franklinton.it (1) [Avatar] Offline
#6
Re: There is no Action mapped for namespace / and action name in struts 2