You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Danny Hurlburt <da...@realgo.com> on 2007/06/13 23:33:56 UTC

Struts2 Not Executing Actions

Hello,

I am new to Struts2 and am running into some problems. I have read much 
of the
documentation on the wiki but I am still stuck.

I have added the filter declaration and filter mapping to web.xml. I have
confirmed that it gets invoked by setting a breakpoint in the doFilter
method. I have created the following struts.xml:

<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
    <package name="root" extends="struts-default" namespace="/">
        <action name="HelloWorld" class="tutorial.HelloWorld">
            <result>/HelloWorld.jsp</result>
        </action>
    </package>
</struts>

I don't have a struts.properties file. I have not set any init-params 
for the
Struts2 filter in web.xml. That is, the default constant configuration is in
effect.

This is running in a web app with a context path of rgg. When making the
following request

http://localhost:7070/rgg/HelloWorld.action

I get the following stack trace (trimmed down for brevity):

There is no Action mapped for namespace / and action name HelloWorld. - 
[unknown location]
    
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186)
    
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41)
    
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:497)
    
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:421)

Has anyone else run into the same problem? Anyone have a solution?

Thanks - Dan

PS - I there anyway I can search the user mailing list before I post 
questions
to see if someone else has previously solved my problem or similar issue?



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts2 Not Executing Actions

Posted by Dave Newton <ne...@yahoo.com>.
--- Danny Hurlburt <da...@realgo.com> wrote:
> The wiki page didn't make it clear that it is 
> required to be on the classpath.

Does now :)

(Or will once it propagates, anyway.)

d.



       
____________________________________________________________________________________
Building a website is a piece of cake. Yahoo! Small Business gives you all the tools to get online.
http://smallbusiness.yahoo.com/webhosting 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts2 Not Executing Actions

Posted by Danny Hurlburt <da...@realgo.com>.
Actually I figured it out. I didn't realize that S2 was expecting 
struts.xml to be on the
classpath. I put it in WEB-INF. The wiki page 
http://cwiki.apache.org/WW/strutsxml.html
didn't make it clear that it is required to be on the classpath. It does 
however state that
the struts-plugin.xml needs to be on the classpath. I should have made 
the connection
sooner. I have used Struts 1.2.x in the past and WEB-INF is the default 
location for a
Struts config file.

Sorry I didn't "close" this thread. Thanks though.

Ian Roughley wrote:
> Can you verify that the struts.xml is in the WAR file, and the 
> location of it?
>
> /Ian
>
> Danny Hurlburt wrote:
>
>> Hello,
>>
>> I am new to Struts2 and am running into some problems. I have read 
>> much of the
>> documentation on the wiki but I am still stuck.
>>
>> I have added the filter declaration and filter mapping to web.xml. I 
>> have
>> confirmed that it gets invoked by setting a breakpoint in the doFilter
>> method. I have created the following struts.xml:
>>
>> <!DOCTYPE struts PUBLIC
>>    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
>>    "http://struts.apache.org/dtds/struts-2.0.dtd">
>> <struts>
>>    <package name="root" extends="struts-default" namespace="/">
>>        <action name="HelloWorld" class="tutorial.HelloWorld">
>>            <result>/HelloWorld.jsp</result>
>>        </action>
>>    </package>
>> </struts>
>>
>> I don't have a struts.properties file. I have not set any init-params 
>> for the
>> Struts2 filter in web.xml. That is, the default constant 
>> configuration is in
>> effect.
>>
>> This is running in a web app with a context path of rgg. When making the
>> following request
>>
>> http://localhost:7070/rgg/HelloWorld.action
>>
>> I get the following stack trace (trimmed down for brevity):
>>
>> There is no Action mapped for namespace / and action name HelloWorld. 
>> - [unknown location]
>>    
>> com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186) 
>>
>>    
>> org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41) 
>>
>>    
>> org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:497) 
>>
>>    
>> org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:421) 
>>
>>
>> Has anyone else run into the same problem? Anyone have a solution?
>>
>> Thanks - Dan
>>
>> PS - I there anyway I can search the user mailing list before I post 
>> questions
>> to see if someone else has previously solved my problem or similar 
>> issue?
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts2 Not Executing Actions

Posted by Ian Roughley <ia...@fdar.com>.
Can you verify that the struts.xml is in the WAR file, and the location 
of it?

/Ian

Danny Hurlburt wrote:

> Hello,
>
> I am new to Struts2 and am running into some problems. I have read 
> much of the
> documentation on the wiki but I am still stuck.
>
> I have added the filter declaration and filter mapping to web.xml. I have
> confirmed that it gets invoked by setting a breakpoint in the doFilter
> method. I have created the following struts.xml:
>
> <!DOCTYPE struts PUBLIC
>    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
>    "http://struts.apache.org/dtds/struts-2.0.dtd">
> <struts>
>    <package name="root" extends="struts-default" namespace="/">
>        <action name="HelloWorld" class="tutorial.HelloWorld">
>            <result>/HelloWorld.jsp</result>
>        </action>
>    </package>
> </struts>
>
> I don't have a struts.properties file. I have not set any init-params 
> for the
> Struts2 filter in web.xml. That is, the default constant configuration 
> is in
> effect.
>
> This is running in a web app with a context path of rgg. When making the
> following request
>
> http://localhost:7070/rgg/HelloWorld.action
>
> I get the following stack trace (trimmed down for brevity):
>
> There is no Action mapped for namespace / and action name HelloWorld. 
> - [unknown location]
>    
> com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186) 
>
>    
> org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41) 
>
>    
> org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:497) 
>
>    
> org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:421) 
>
>
> Has anyone else run into the same problem? Anyone have a solution?
>
> Thanks - Dan
>
> PS - I there anyway I can search the user mailing list before I post 
> questions
> to see if someone else has previously solved my problem or similar issue?
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts2 Not Executing Actions

Posted by ANIMESH SAXENA <an...@gmail.com>.
Generally this occurs if there is no method defined for the
action.......guess struts.xml is missin for indicatin the default
method.....
try addin method="execute()" to the definition......if it works...some
problem with struts.xml....

Animesh


On 6/13/07, Danny Hurlburt <da...@realgo.com> wrote:
>
> Hello,
>
> I am new to Struts2 and am running into some problems. I have read much
> of the
> documentation on the wiki but I am still stuck.
>
> I have added the filter declaration and filter mapping to web.xml. I have
> confirmed that it gets invoked by setting a breakpoint in the doFilter
> method. I have created the following struts.xml:
>
> <!DOCTYPE struts PUBLIC
>     "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
>     "http://struts.apache.org/dtds/struts-2.0.dtd">
> <struts>
>     <package name="root" extends="struts-default" namespace="/">
>         <action name="HelloWorld" class="tutorial.HelloWorld">
>             <result>/HelloWorld.jsp</result>
>         </action>
>     </package>
> </struts>
>
> I don't have a struts.properties file. I have not set any init-params
> for the
> Struts2 filter in web.xml. That is, the default constant configuration is
> in
> effect.
>
> This is running in a web app with a context path of rgg. When making the
> following request
>
> http://localhost:7070/rgg/HelloWorld.action
>
> I get the following stack trace (trimmed down for brevity):
>
> There is no Action mapped for namespace / and action name HelloWorld. -
> [unknown location]
>
> com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java
> :186)
>
> org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(
> StrutsActionProxyFactory.java:41)
>
> org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java
> :497)
>
> org.apache.struts2.dispatcher.FilterDispatcher.doFilter(
> FilterDispatcher.java:421)
>
> Has anyone else run into the same problem? Anyone have a solution?
>
> Thanks - Dan
>
> PS - I there anyway I can search the user mailing list before I post
> questions
> to see if someone else has previously solved my problem or similar issue?
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Animesh Saxena
Software Architect

http://inlovewithlinux.blogspot.com
http://ihateaspdotnet.blogspot.com