Unable to use 'categories' in an action name

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Unable to use 'categories' in an action name

Dave Weis
I hope this is something simple I've missed. I am unable to use the word
'categories' as an action name inside a package. Duplicating the action
definition with a different name works fine.

I've reproduced it as far as I can understand but there is something else
going on. Relevant struts config and exception are below. There are action
definitions between the non functional action and the package.

From this config I can go to /commerce/knobhead and see the correct page
but /commerce/categories gives the exception. The word categories only
exists in my struts.xml for these two actions

Thanks
dave




<package name="commerce" extends="default" namespace="/commerce">

<action name="knobhead"
class="com.foo.actions.commerce.CategoriesAction">
<result name="success" type="tiles">commerce.categories</result>
</action>

<action name="productcategories"
class="com.foo.actions.commerce.CategoriesAction">
<result name="success" type="tiles">commerce.categories</result>
</action>


ERROR Dispatcher Could not find action or result:
/SUBECON/commerce/categories
 No result defined for action com.foo.actions.commerce.CategoriesAction and
result success
at
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:375)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:277)
at
org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:253)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
at
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)
at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
at
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:260)
at
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:52)
at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
at
com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.doIntercept(ConversionErrorInterceptor.java:139)
at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
at
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:134)
at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
at
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:134)
at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
at
com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:199)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
at
org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:69)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
at
org.apache.struts2.interceptor.DateTextFieldInterceptor.intercept(DateTextFieldInterceptor.java:115)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
at
org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:88)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
at
org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:246)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
at
com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:99)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
at
com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:139)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
at
com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:157)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
at
com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:174)
at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
at
org.apache.struts2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:123)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
at
org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:171)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
at
com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:201)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
at
com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:193)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
at
org.apache.struts2.factory.StrutsActionProxy.execute(StrutsActionProxy.java:53)
at
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:577)
at
org.apache.struts2.dispatcher.ExecuteOperations.executeAction(ExecuteOperations.java:81)
at
org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:143)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.subecon.filter.SiteFilter.doFilter(SiteFilter.java:80)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:651)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:500)
at
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754)
at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1376)
at
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)

Tiles:

  <definition name="commerce.categories" extends="commerceLayout">
      <put-attribute name="title"  value="Category List" />
      <put-attribute name="body"
 value="/WEB-INF/jsp/commerce/categories.jsp" />
  </definition>
Reply | Threaded
Open this post in threaded view
|

Re: Unable to use 'categories' in an action name

Yasser Zamani-2


On 12/9/2017 9:12 PM, Dave Weis wrote:
> <action name="productcategories"

But it's name has `product` as prefix here.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Unable to use 'categories' in an action name

Dave Weis
Correct, I want 'categories' to be the correct action name. I made a
duplicate with a different name but the same class and results and it works
fine. If I remove the first action I put in to test/reproduce this I still
get the same error.

I have my struts.xml cut down to the below and I still can't get to
/commerce/categories successfully but /commerce/knobhead works fine at the
same time.

<package name="default" extends="struts-default" namespace="/">

<result-types>
<result-type name="tiles"
class="org.apache.struts2.views.tiles.TilesResult" />
</result-types>

</package>

<package name="commerce" extends="default" namespace="/commerce">

<action name="knobhead"
class="com.foo.actions.commerce.CategoriesAction">
<result name="success" type="tiles">commerce.categories</result>
</action>

<action name="categories"
class="com.foo.actions.commerce.CategoriesAction">
<result name="success" type="tiles">commerce.categories</result>
</action>

</package>





2017-12-10 6:43 GMT-06:00 Yasser Zamani <[hidden email]>:

>
>
> On 12/9/2017 9:12 PM, Dave Weis wrote:
> > <action name="productcategories"
>
> But it's name has `product` as prefix here.
>
Reply | Threaded
Open this post in threaded view
|

Re: Unable to use 'categories' in an action name

Lukasz Lenart
Can you post once again a full stack and related configuration?
Because in you first mail there is no action defined as "categories"
but "productcategories"

2017-12-10 15:36 GMT+01:00 Dave Weis <[hidden email]>:

> Correct, I want 'categories' to be the correct action name. I made a
> duplicate with a different name but the same class and results and it works
> fine. If I remove the first action I put in to test/reproduce this I still
> get the same error.
>
> I have my struts.xml cut down to the below and I still can't get to
> /commerce/categories successfully but /commerce/knobhead works fine at the
> same time.
>
> <package name="default" extends="struts-default" namespace="/">
>
> <result-types>
> <result-type name="tiles"
> class="org.apache.struts2.views.tiles.TilesResult" />
> </result-types>
>
> </package>
>
> <package name="commerce" extends="default" namespace="/commerce">
>
> <action name="knobhead"
> class="com.foo.actions.commerce.CategoriesAction">
> <result name="success" type="tiles">commerce.categories</result>
> </action>
>
> <action name="categories"
> class="com.foo.actions.commerce.CategoriesAction">
> <result name="success" type="tiles">commerce.categories</result>
> </action>
>
> </package>
>
>
>
>
>
> 2017-12-10 6:43 GMT-06:00 Yasser Zamani <[hidden email]>:
>
>>
>>
>> On 12/9/2017 9:12 PM, Dave Weis wrote:
>> > <action name="productcategories"
>>
>> But it's name has `product` as prefix here.
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Unable to use 'categories' in an action name

Dave Weis
The productcategories vs categories was just to see if there was a
collision in a different action definition.

The full stack trace follows. The previous email contained my corrected
struts.xml definition with only a couple actions.

Thanks for looking at it
dave


Struts Problem Report

Struts has detected an unhandled exception:
*Messages*:
- No result defined for action
com.subecon.actions.commerce.CategoriesAction and result success
------------------------------
Stacktraces
*No result defined for action com.subecon.actions.commerce.CategoriesAction
and result success*

    com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:375)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:277)
    org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:253)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
    com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)
    com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
    com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:260)
    org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:52)
    com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
    com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.doIntercept(ConversionErrorInterceptor.java:139)
    com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
    com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:134)
    com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
    com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:134)
    com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
    com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:199)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
    org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:69)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
    org.apache.struts2.interceptor.DateTextFieldInterceptor.intercept(DateTextFieldInterceptor.java:115)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
    org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:88)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
    org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:246)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
    com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:99)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
    com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:139)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
    com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:157)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
    com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:174)
    com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
    org.apache.struts2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:123)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
    org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:171)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
    com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:201)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
    com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:193)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
    org.apache.struts2.factory.StrutsActionProxy.execute(StrutsActionProxy.java:53)
    org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:577)
    org.apache.struts2.dispatcher.ExecuteOperations.executeAction(ExecuteOperations.java:81)
    org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:143)
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    com.subecon.filter.SiteFilter.doFilter(SiteFilter.java:80)
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475)
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
    org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:651)
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
    org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:500)
    org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754)
    org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1376)
    org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    java.lang.Thread.run(Unknown Source)
Reply | Threaded
Open this post in threaded view
|

Re: Unable to use 'categories' in an action name

Yasser Zamani-2
In reply to this post by Dave Weis


On 12/10/2017 6:06 PM, Dave Weis wrote:
> Correct, I want 'categories' to be the correct action name. I made a
> duplicate with a different name but the same class and results and it works
> fine. If I remove the first action I put in to test/reproduce this I still
> get the same error.
>
> I have my struts.xml cut down to the below and I still can't get to
> /commerce/categories successfully but /commerce/knobhead works fine at the
> same time.

I locally tested exactly same configuration and both knobhead and
categories work here.

If I were you, I would search all xml and java files for term
`categories`. Maybe an action, servlet, etc is defined with same name
somewhere via xml or annotation!

I hope this helps,
Yasser.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Unable to use 'categories' in an action name

Dave Weis
Thank you so much for your help - I appreciate it. I ended up just renaming
the action and corrected the other pages pointing to it.

dave



On Sun, Dec 10, 2017 at 11:56 PM, Yasser Zamani <[hidden email]>
wrote:

>
>
> On 12/10/2017 6:06 PM, Dave Weis wrote:
> > Correct, I want 'categories' to be the correct action name. I made a
> > duplicate with a different name but the same class and results and it
> works
> > fine. If I remove the first action I put in to test/reproduce this I
> still
> > get the same error.
> >
> > I have my struts.xml cut down to the below and I still can't get to
> > /commerce/categories successfully but /commerce/knobhead works fine at
> the
> > same time.
>
> I locally tested exactly same configuration and both knobhead and
> categories work here.
>
> If I were you, I would search all xml and java files for term
> `categories`. Maybe an action, servlet, etc is defined with same name
> somewhere via xml or annotation!
>
> I hope this helps,
> Yasser.
>