You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Scott Stanlick (JIRA)" <ji...@apache.org> on 2007/03/02 17:05:16 UTC
[jira] Created: (WW-1785) Validator fails on an action that does
not extend ActionSupport
Validator fails on an action that does not extend ActionSupport
---------------------------------------------------------------
Key: WW-1785
URL: https://issues.apache.org/struts/browse/WW-1785
Project: Struts 2
Issue Type: Bug
Components: Actions
Affects Versions: 2.0.6
Environment: Windows XP
Reporter: Scott Stanlick
I had an S2 app working great until this morning when I changed my custom BaseAction class to no longer extend ActionSupport. I am getting the following exception and quietly being directed to an incorrect Result. I am receiving the validator message in the server console.
09:46:53,416 ERROR Login:279 - Validation error for password: is required.
SEVERE: Servlet.service() for servlet default threw exception
java.lang.NoSuchMethodException: actions.Login.execute()
at java.lang.Class.getMethod(Class.java:1581)
at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.getActionMethod(AnnotationValidationInterceptor.java:55)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (WW-1785) Validator fails on an action that does
not extend ActionSupport
Posted by "Tom Schneider (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-1785?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tom Schneider resolved WW-1785.
-------------------------------
Resolution: Not A Problem
Fix Version/s: 2.1.0
2.0.7
Assignee: Tom Schneider
It looks to me like your action doesn't implement an execute() method. When you removed ActionSupport as a superclass, the execute() method was no longer available. To fix this, simple implement the execute() method in your action. If this doesn't resolve your issue, please post a message to the struts user mailing list.
> Validator fails on an action that does not extend ActionSupport
> ---------------------------------------------------------------
>
> Key: WW-1785
> URL: https://issues.apache.org/struts/browse/WW-1785
> Project: Struts 2
> Issue Type: Bug
> Components: Actions
> Affects Versions: 2.0.6
> Environment: Windows XP
> Reporter: Scott Stanlick
> Assigned To: Tom Schneider
> Fix For: 2.0.7, 2.1.0
>
>
> I had an S2 app working great until this morning when I changed my custom BaseAction class to no longer extend ActionSupport. I am getting the following exception and quietly being directed to an incorrect Result. I am receiving the validator message in the server console.
> 09:46:53,416 ERROR Login:279 - Validation error for password: is required.
> SEVERE: Servlet.service() for servlet default threw exception
> java.lang.NoSuchMethodException: actions.Login.execute()
> at java.lang.Class.getMethod(Class.java:1581)
> at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.getActionMethod(AnnotationValidationInterceptor.java:55)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WW-1785) Validator fails on an action that does
not extend ActionSupport
Posted by "Tom Schneider (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-1785?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_40406 ]
Tom Schneider commented on WW-1785:
-----------------------------------
Actually looking at the JUnit test, AnnotationValidationInterceptorTest, this test is doing exactly what you are trying to do. It has a TestAction class that isn't extending ActionSupport and this test works perfectly fine. The method signature of this method is:
public String execute();
It looks like the interceptor is trying execute() first, then it tries get doExecute(), if it doesn't find either of these methods, then the interceptor throws the original MethodNotFoundException. I can't think of why this interceptor is failing for you. It might be helpful to debug into the interceptor and just verify that the actionClass is correct.
> Validator fails on an action that does not extend ActionSupport
> ---------------------------------------------------------------
>
> Key: WW-1785
> URL: https://issues.apache.org/struts/browse/WW-1785
> Project: Struts 2
> Issue Type: Bug
> Components: Actions
> Affects Versions: 2.0.6
> Environment: Windows XP
> Reporter: Scott Stanlick
> Assigned To: Tom Schneider
> Fix For: 2.0.7, 2.1.0
>
>
> I had an S2 app working great until this morning when I changed my custom BaseAction class to no longer extend ActionSupport. I am getting the following exception and quietly being directed to an incorrect Result. I am receiving the validator message in the server console.
> 09:46:53,416 ERROR Login:279 - Validation error for password: is required.
> SEVERE: Servlet.service() for servlet default threw exception
> java.lang.NoSuchMethodException: actions.Login.execute()
> at java.lang.Class.getMethod(Class.java:1581)
> at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.getActionMethod(AnnotationValidationInterceptor.java:55)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WW-1785) Validator fails on an action that does
not extend ActionSupport
Posted by "Scott Stanlick (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-1785?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_40412 ]
Scott Stanlick commented on WW-1785:
------------------------------------
Wow! I don't get this caliber of service from BEA. Is the execute method
required if you are using wildcard mappings and never reference the action
without a qualified
myMapping!someMethod qualifier?
Also, how does the validator work when not using ActionSupport and is there
a convenient way to access getText without ActionSupport? Lastly, do you
see a problem using action classes that are strictly POJO? How much
"support" do you give up?
Thanks,
Scott Stanlick
IT Architect
Enterprise Rent-A-Car
--
Scott
stanlick@gmail.com
> Validator fails on an action that does not extend ActionSupport
> ---------------------------------------------------------------
>
> Key: WW-1785
> URL: https://issues.apache.org/struts/browse/WW-1785
> Project: Struts 2
> Issue Type: Bug
> Components: Actions
> Affects Versions: 2.0.6
> Environment: Windows XP
> Reporter: Scott Stanlick
> Assigned To: Tom Schneider
> Fix For: 2.0.7, 2.1.0
>
>
> I had an S2 app working great until this morning when I changed my custom BaseAction class to no longer extend ActionSupport. I am getting the following exception and quietly being directed to an incorrect Result. I am receiving the validator message in the server console.
> 09:46:53,416 ERROR Login:279 - Validation error for password: is required.
> SEVERE: Servlet.service() for servlet default threw exception
> java.lang.NoSuchMethodException: actions.Login.execute()
> at java.lang.Class.getMethod(Class.java:1581)
> at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.getActionMethod(AnnotationValidationInterceptor.java:55)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WW-1785) Validator fails on an action that does
not extend ActionSupport
Posted by "Tom Schneider (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-1785?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_40405 ]
Tom Schneider commented on WW-1785:
-----------------------------------
It should work fine without extending ActionSupport, ActionSupport is just a convenience. That method is looking for an 'execute' method that takes no parameters. I'll try to create a JUnit test to reproduce the issue. That should give me a good idea of why it's failing.
> Validator fails on an action that does not extend ActionSupport
> ---------------------------------------------------------------
>
> Key: WW-1785
> URL: https://issues.apache.org/struts/browse/WW-1785
> Project: Struts 2
> Issue Type: Bug
> Components: Actions
> Affects Versions: 2.0.6
> Environment: Windows XP
> Reporter: Scott Stanlick
> Assigned To: Tom Schneider
> Fix For: 2.0.7, 2.1.0
>
>
> I had an S2 app working great until this morning when I changed my custom BaseAction class to no longer extend ActionSupport. I am getting the following exception and quietly being directed to an incorrect Result. I am receiving the validator message in the server console.
> 09:46:53,416 ERROR Login:279 - Validation error for password: is required.
> SEVERE: Servlet.service() for servlet default threw exception
> java.lang.NoSuchMethodException: actions.Login.execute()
> at java.lang.Class.getMethod(Class.java:1581)
> at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.getActionMethod(AnnotationValidationInterceptor.java:55)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WW-1785) Validator fails on an action that does
not extend ActionSupport
Posted by "Scott Stanlick (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-1785?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_40404 ]
Scott Stanlick commented on WW-1785:
------------------------------------
Hi Tom --
My class has an execute method, so this is not the issue. I would rather
not extend ActionSupport and the docs suggest that "Action" classes can be
POJO's. If the actions have an execute() method but DO NOT extend
ActionSupport, how does this alter the S2 request/response life cycle?
Obviously ActionSupport is more than just "support" if subtracting it from
the class hierarchy breaks the app. Specifically, can I leverage the
validator feature without extending ActionSupport?
Thanks,
Scott
--
Scott
stanlick@gmail.com
> Validator fails on an action that does not extend ActionSupport
> ---------------------------------------------------------------
>
> Key: WW-1785
> URL: https://issues.apache.org/struts/browse/WW-1785
> Project: Struts 2
> Issue Type: Bug
> Components: Actions
> Affects Versions: 2.0.6
> Environment: Windows XP
> Reporter: Scott Stanlick
> Assigned To: Tom Schneider
> Fix For: 2.0.7, 2.1.0
>
>
> I had an S2 app working great until this morning when I changed my custom BaseAction class to no longer extend ActionSupport. I am getting the following exception and quietly being directed to an incorrect Result. I am receiving the validator message in the server console.
> 09:46:53,416 ERROR Login:279 - Validation error for password: is required.
> SEVERE: Servlet.service() for servlet default threw exception
> java.lang.NoSuchMethodException: actions.Login.execute()
> at java.lang.Class.getMethod(Class.java:1581)
> at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.getActionMethod(AnnotationValidationInterceptor.java:55)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WW-1785) Validator fails on an action that does
not extend ActionSupport
Posted by "Tom Schneider (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/WW-1785?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_40413 ]
Tom Schneider commented on WW-1785:
-----------------------------------
As far as I can tell, the method that gets executed in the action invocation is the same method used in the validation interceptor. I would add an execute method and see if that makes it work and set a breakpoint to see if it is actually calling the execute method. My guess is that the method qualifier is getting lost somewhere along the way. (perhaps via a redirect)
For your other questions, please make use of the struts user list: http://struts.apache.org/mail.html
> Validator fails on an action that does not extend ActionSupport
> ---------------------------------------------------------------
>
> Key: WW-1785
> URL: https://issues.apache.org/struts/browse/WW-1785
> Project: Struts 2
> Issue Type: Bug
> Components: Actions
> Affects Versions: 2.0.6
> Environment: Windows XP
> Reporter: Scott Stanlick
> Assigned To: Tom Schneider
> Fix For: 2.0.7, 2.1.0
>
>
> I had an S2 app working great until this morning when I changed my custom BaseAction class to no longer extend ActionSupport. I am getting the following exception and quietly being directed to an incorrect Result. I am receiving the validator message in the server console.
> 09:46:53,416 ERROR Login:279 - Validation error for password: is required.
> SEVERE: Servlet.service() for servlet default threw exception
> java.lang.NoSuchMethodException: actions.Login.execute()
> at java.lang.Class.getMethod(Class.java:1581)
> at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.getActionMethod(AnnotationValidationInterceptor.java:55)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.