You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by mu...@aol.com on 2009/03/26 10:59:34 UTC
ExecuteAndWaitInterceptor not working (2.1.6)
execAndWait in 2.1.6 gives the following exception when it kicks in: (code pasted below)
java.lang.UnsupportedOperationException
??? java.util.Collections$UnmodifiableMap.put(Collections.java:1285)
??? org.apache.struts2.interceptor.ExecuteAndWaitInterceptor.doIntercept(ExecuteAndWaitInterceptor.java:256)
??? com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
??? com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
??? com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
??? com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
??? com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
??? org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
??? org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:468)
??? org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395)
??? org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
??? org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
??? org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
??? org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
??? org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
??? org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
??? org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
??? org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
??? org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
??? org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
??? org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
??? java.lang.Thread.run(Thread.java:619)
CODE:
Input JSP: (WEB-INF/content/all/index.jsp
<%@ taglib prefix="s" uri="/struts-tags"%>
<html>
??? <head>
??? ??? <title>Hello World</title>
??? </head>
??? <body>
??? ??? <h3>
??? ??? ??? Enter Your Name
??? ??? </h3>
??? ??? <div>
??? ??? ??? <s:form action="say-hello">
??? ??? ??? ??? <s:textfield label="Name:" name="userName" size="30" maxlength="30" />
??? ??? ??? ??? <s:submit value="Submit" />
??? ??? ??? </s:form>
??? ??? </div>
??? </body>
</html>
============
Configuration (struts.xml)
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
??? "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
??? "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
??? <constant name="struts.enable.DynamicMethodInvocation" value="false" />
??? <constant name="struts.devMode" value="true" />
??? <constant name="struts.convention.classes.reload" value="true" />
??? <constant name="struts.convention.action.disableScanning" value="true" />
???
??? <package name="all" namespace="/all" extends="struts-default">
??? ??? <action name="say-hello" class="actions.all.SayHelloAction">
??? ??? ??? <interceptor-ref name="params" />
??? ??? ???
??? ??? ??? <interceptor-ref name="execAndWait">
??? ??? ??? ??? <param name="delay">1000</param>
??? ??? ??? ??? <param name="delaySleepInterval">50</param>
??? ??? ??? </interceptor-ref>
??? ??? ???
??? ??? ??? <result name="success">/WEB-INF/content/all/say-hello-success.jsp
??? ??? ??? </result>
??? ??? </action>
??? </package>
</struts>
=======
Action (actions.all.SayHelloAction.java)
package actions.all;
import java.util.Date;
public class SayHelloAction{
??? private static final long serialVersionUID = 1L;
??? private String userName;
??? public String execute() throws Exception {
??? ??? wasteTime(10000);
??? ??? return "success";
??? }
??? public String getUserName() {
??? ??? return userName;
??? }
??? public void setUserName(String userName) {
??? ??? this.userName = userName;
??? }
???
??? private void wasteTime(long time){
??? ??? long start = new Date().getTime();
??? ??? while(new Date().getTime()-start < time){
??? ??? ??? try {
??? ??? ??? ??? Thread.sleep(100L);
??? ??? ??? } catch (InterruptedException e) {
??? ??? ??? ??? e.printStackTrace();
??? ??? ??? }
??? ??? }
??? }
}
=====
Output page (WEB-INF/content/all/say-hello-success.jsp)
<%@ taglib prefix="s" uri="/struts-tags"%>
<html>
??? <head>
??? ??? <title>Hello Success</title>
??? </head>
??? <body>
??? Hello <s:property value="userName" />
??? </body>
</html>
Cheers
Chris M.
Re: ExecuteAndWaitInterceptor not working (2.1.6)
Posted by Musachy Barroso <mu...@gmail.com>.
I think we should throw an exception, but that would break backward
compatibility. It will still create a page but the implementation is a
little bit different.
musachy
On Wed, Apr 1, 2009 at 9:31 PM, <mu...@aol.com> wrote:
>
>
>
>
> Thanks --? I think Struts 2.0.x had an earlier version of the interceptor that would create a wait page dynamically.? No problem as long as it is the expected behavior.
> That being the case, perhaps we should change the documentation at
> http://struts.apache.org/2.x/docs/execute-and-wait-interceptor.html
> to not say
> If no "wait" result is found, Struts will automatically generate a wait result on the fly.
> Chris
>
>
>
>
>
> -----Original Message-----
> From: Musachy Barroso <mu...@gmail.com>
> To: Struts Users Mailing List <us...@struts.apache.org>
> Sent: Wed, 1 Apr 2009 6:25 pm
> Subject: Re: ExecuteAndWaitInterceptor not working (2.1.6)
>
>
>
>
>
>
>
>
>
>
> Sorry I hadn't looked at this in detail. As Dale said, you need to
> define a "wait" result. Struts should not be trying to create it if it
> isn't there, it should throw an exception instead.
>
> musachy
>
> On Wed, Apr 1, 2009 at 11:30 AM, <mu...@aol.com> wrote:
>>
>> ?Will do.
>> Chris
>>
>>
>>
>>
>>
>>
>>
>> -----Original Message-----
>> From: Musachy Barroso <mu...@gmail.com>
>> To: Struts Users Mailing List <us...@struts.apache.org>
>> Sent: Tue, 31 Mar 2009 11:09 am
>> Subject: Re: ExecuteAndWaitInterceptor not working (2.1.6)
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> Add the full stack trace and as much information as possible.
>>
>> thanks
>> musachy
>>
>> On Tue, Mar 31, 2009 at 10:58 AM, Dale Newfield <da...@newfield.org> wrote:
>>> musomesa@aol.com wrote:
>>>>
>>>> Exactly -- used to work in 2.0.x but must have broken in the transition.
>>>
>>> Please create a JIRA issue for this.
>>>
>>> -Dale
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>
>>
>>
>> --
>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>>
>>
>>
>>
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
>
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: ExecuteAndWaitInterceptor not working (2.1.6)
Posted by mu...@aol.com.
Thanks --? I think Struts 2.0.x had an earlier version of the interceptor that would create a wait page dynamically.? No problem as long as it is the expected behavior.
That being the case, perhaps we should change the documentation at
http://struts.apache.org/2.x/docs/execute-and-wait-interceptor.html
to not say
If no "wait" result is found, Struts will automatically generate a wait result on the fly.
Chris
-----Original Message-----
From: Musachy Barroso <mu...@gmail.com>
To: Struts Users Mailing List <us...@struts.apache.org>
Sent: Wed, 1 Apr 2009 6:25 pm
Subject: Re: ExecuteAndWaitInterceptor not working (2.1.6)
Sorry I hadn't looked at this in detail. As Dale said, you need to
define a "wait" result. Struts should not be trying to create it if it
isn't there, it should throw an exception instead.
musachy
On Wed, Apr 1, 2009 at 11:30 AM, <mu...@aol.com> wrote:
>
> ?Will do.
> Chris
>
>
>
>
>
>
>
> -----Original Message-----
> From: Musachy Barroso <mu...@gmail.com>
> To: Struts Users Mailing List <us...@struts.apache.org>
> Sent: Tue, 31 Mar 2009 11:09 am
> Subject: Re: ExecuteAndWaitInterceptor not working (2.1.6)
>
>
>
>
>
>
>
>
>
>
> Add the full stack trace and as much information as possible.
>
> thanks
> musachy
>
> On Tue, Mar 31, 2009 at 10:58 AM, Dale Newfield <da...@newfield.org> wrote:
>> musomesa@aol.com wrote:
>>>
>>> Exactly -- used to work in 2.0.x but must have broken in the transition.
>>
>> Please create a JIRA issue for this.
>>
>> -Dale
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
>
>
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: ExecuteAndWaitInterceptor not working (2.1.6)
Posted by Musachy Barroso <mu...@gmail.com>.
Sorry I hadn't looked at this in detail. As Dale said, you need to
define a "wait" result. Struts should not be trying to create it if it
isn't there, it should throw an exception instead.
musachy
On Wed, Apr 1, 2009 at 11:30 AM, <mu...@aol.com> wrote:
>
> Will do.
> Chris
>
>
>
>
>
>
>
> -----Original Message-----
> From: Musachy Barroso <mu...@gmail.com>
> To: Struts Users Mailing List <us...@struts.apache.org>
> Sent: Tue, 31 Mar 2009 11:09 am
> Subject: Re: ExecuteAndWaitInterceptor not working (2.1.6)
>
>
>
>
>
>
>
>
>
>
> Add the full stack trace and as much information as possible.
>
> thanks
> musachy
>
> On Tue, Mar 31, 2009 at 10:58 AM, Dale Newfield <da...@newfield.org> wrote:
>> musomesa@aol.com wrote:
>>>
>>> Exactly -- used to work in 2.0.x but must have broken in the transition.
>>
>> Please create a JIRA issue for this.
>>
>> -Dale
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
>
>
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: ExecuteAndWaitInterceptor not working (2.1.6)
Posted by mu...@aol.com.
Will do.
Chris
-----Original Message-----
From: Musachy Barroso <mu...@gmail.com>
To: Struts Users Mailing List <us...@struts.apache.org>
Sent: Tue, 31 Mar 2009 11:09 am
Subject: Re: ExecuteAndWaitInterceptor not working (2.1.6)
Add the full stack trace and as much information as possible.
thanks
musachy
On Tue, Mar 31, 2009 at 10:58 AM, Dale Newfield <da...@newfield.org> wrote:
> musomesa@aol.com wrote:
>>
>> Exactly -- used to work in 2.0.x but must have broken in the transition.
>
> Please create a JIRA issue for this.
>
> -Dale
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: ExecuteAndWaitInterceptor not working (2.1.6)
Posted by Musachy Barroso <mu...@gmail.com>.
Add the full stack trace and as much information as possible.
thanks
musachy
On Tue, Mar 31, 2009 at 10:58 AM, Dale Newfield <da...@newfield.org> wrote:
> musomesa@aol.com wrote:
>>
>> Exactly -- used to work in 2.0.x but must have broken in the transition.
>
> Please create a JIRA issue for this.
>
> -Dale
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: ExecuteAndWaitInterceptor not working (2.1.6)
Posted by Dale Newfield <da...@newfield.org>.
musomesa@aol.com wrote:
> Exactly -- used to work in 2.0.x but must have broken in the transition.
Please create a JIRA issue for this.
-Dale
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: ExecuteAndWaitInterceptor not working (2.1.6)
Posted by mu...@aol.com.
Exactly -- used to work in 2.0.x but must have broken in the transition.
Chris
-----Original Message-----
From: Dale Newfield <da...@newfield.org>
To: Struts Users Mailing List <us...@struts.apache.org>
Sent: Mon, 30 Mar 2009 3:51 pm
Subject: Re: ExecuteAndWaitInterceptor not working (2.1.6)
musomesa@aol.com wrote:?
> execAndWait in 2.1.6 gives the following exception when it kicks in: (code pasted below)?
>
>
> java.lang.UnsupportedOperationException
> ??? java.util.Collections$UnmodifiableMap.put(Collections.java:1285)?
> ??? org.apache.struts2.interceptor.ExecuteAndWaitInterceptor.doIntercept(ExecuteAndWaitInterceptor.java:256)?
?
Not sure why the problem is occurring, but looking at that section of
code suggests having a real "wait" result rather than letting struts
auto-build one for you should be a workaround for the bug.?
?
-Dale?
?
---------------------------------------------------------------------?
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org?
For additional commands, e-mail: user-help@struts.apache.org?
?
Re: ExecuteAndWaitInterceptor not working (2.1.6)
Posted by Dale Newfield <da...@newfield.org>.
musomesa@aol.com wrote:
> execAndWait in 2.1.6 gives the following exception when it kicks in: (code pasted below)
>
>
> java.lang.UnsupportedOperationException
> ??? java.util.Collections$UnmodifiableMap.put(Collections.java:1285)
> ??? org.apache.struts2.interceptor.ExecuteAndWaitInterceptor.doIntercept(ExecuteAndWaitInterceptor.java:256)
Not sure why the problem is occurring, but looking at that section of
code suggests having a real "wait" result rather than letting struts
auto-build one for you should be a workaround for the bug.
-Dale
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org