You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Lorne Malvo <ca...@gmail.com> on 2014/07/29 16:12:34 UTC

Getting intermittent ListenerInvocationNotAllowedException with AjaxEventBehavior

I'm getting an intermittent ListenerInvocationNotAllowedException when using
an AjaxEventBehaviors.
(stacktrace below)

This is my code:

----------------------------

WebMarkupContainer con = new WebMarkupContainer( "container" ) {
      @Override
      protected void onConfigure() {
        super.onConfigure();
        setVisible( someFlag);
      }
    };
    con.setOutputMarkupId( true );
    con.setOutputMarkupPlaceholderTag( true );

    con.add( new AjaxEventBehavior( "onmouseover" ) {
      @Override
      protected void onEvent(AjaxRequestTarget target) {
        someFlag = true;
        target.add( someLargerContainerComponent );
      }
    } );

---------------------

In the same panel, I have a second container with a second AjaxEventBehavior
attached. The code is the same as above, except that the behavior uses the
"onmouseout" event and the someFlag logic is reversed. The idea is that a
visible <div> is swapped out for another <div> on mouseover, and then the
swap is reversed on mouseout.
This works fine - except sometimes it doesn't. I would say the exception
occurs in about 1 out of 40 mouseovers/mouseouts. I can't discern a pattern. 
I've tested this in FF and Chrome on Windows and the problem occurs in both
browsers.


I did read
https://issues.apache.org/jira/browse/WICKET-5603
which seems to suggest that this problem has been fixed - but I guess it
hasn't. I'm using Wicket 6.16.0.
(the workaround suggested in the jira comments doesn't apply to me since my
behaviors are not attached to form components)

Any suggestions on how to catch this exception or for another workaround?

Thanks!

 

29 Jul 2014 15:44:21,930 WARN  RequestCycleExtra 342:
********************************
29 Jul 2014 15:44:21,932 WARN  RequestCycleExtra 343: Handling the following
exception
org.apache.wicket.core.request.handler.ListenerInvocationNotAllowedException:
Behavior rejected interface invocation. Component: [WebMarkupContainer
[Component id = myComponentId]] Behavior:
com.myDomain.web.myPanel$2@293d7910 Listener: [RequestListenerInterface
name=IBehaviorListener, method=public abstract void
org.apache.wicket.behavior.IBehaviorListener.onRequest()]
	at
org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:237)
	at
org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:250)
	at
org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:236)
	at
org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:862)
	at
org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
	at
org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:261)
	at
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:218)
	at
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:289)
	at
org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:259)
	at
org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:201)
	at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:282)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
	at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
	at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
	at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:250)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
	at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:662)
29 Jul 2014 15:44:21,933 WARN  RequestCycleExtra 344:
********************************

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Getting-intermittent-ListenerInvocationNotAllowedException-with-AjaxEventBehavior-tp4666782.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Getting intermittent ListenerInvocationNotAllowedException with AjaxEventBehavior

Posted by Sven Meier <sv...@meiers.net>.
Hi,

there might be other solutions too, but perhaps the child selector will 
fit nicely:

https://issues.apache.org/jira/browse/WICKET-5512

Regards
Sven

On 07/30/2014 07:33 PM, Lorne Malvo wrote:
> Hmmm I tried to figure out how to do that but I don't get it.
> I know to override updateAjaxAttributes() but I'm not sure how of the
> meaning/function of the childSelector filter string. "The selector string
> that filters the descendants" doesn't make too much sense, and I can't find
> any other documentation. childSelector is not explained in the apache
> wicket, either.
> Would you mind elaborating?
>
> Thank you!
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Getting-intermittent-ListenerInvocationNotAllowedException-with-AjaxEventBehavior-tp4666782p4666806.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Getting intermittent ListenerInvocationNotAllowedException with AjaxEventBehavior

Posted by Lorne Malvo <ca...@gmail.com>.
Hmmm I tried to figure out how to do that but I don't get it. 
I know to override updateAjaxAttributes() but I'm not sure how of the
meaning/function of the childSelector filter string. "The selector string
that filters the descendants" doesn't make too much sense, and I can't find
any other documentation. childSelector is not explained in the apache
wicket, either.
Would you mind elaborating?

Thank you!

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Getting-intermittent-ListenerInvocationNotAllowedException-with-AjaxEventBehavior-tp4666782p4666806.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Getting intermittent ListenerInvocationNotAllowedException with AjaxEventBehavior

Posted by Sven Meier <sv...@meiers.net>.
Hi,

the request comes in when the component is already/again invisible on 
the server.

Try adding the behavior higher up in the component hierarchy with 
AjaxRequestAttributes#childSelector.

Sven

On 07/29/2014 04:12 PM, Lorne Malvo wrote:
> I'm getting an intermittent ListenerInvocationNotAllowedException when using
> an AjaxEventBehaviors.
> (stacktrace below)
>
> This is my code:
>
> ----------------------------
>
> WebMarkupContainer con = new WebMarkupContainer( "container" ) {
>        @Override
>        protected void onConfigure() {
>          super.onConfigure();
>          setVisible( someFlag);
>        }
>      };
>      con.setOutputMarkupId( true );
>      con.setOutputMarkupPlaceholderTag( true );
>
>      con.add( new AjaxEventBehavior( "onmouseover" ) {
>        @Override
>        protected void onEvent(AjaxRequestTarget target) {
>          someFlag = true;
>          target.add( someLargerContainerComponent );
>        }
>      } );
>
> ---------------------
>
> In the same panel, I have a second container with a second AjaxEventBehavior
> attached. The code is the same as above, except that the behavior uses the
> "onmouseout" event and the someFlag logic is reversed. The idea is that a
> visible <div> is swapped out for another <div> on mouseover, and then the
> swap is reversed on mouseout.
> This works fine - except sometimes it doesn't. I would say the exception
> occurs in about 1 out of 40 mouseovers/mouseouts. I can't discern a pattern.
> I've tested this in FF and Chrome on Windows and the problem occurs in both
> browsers.
>
>
> I did read
> https://issues.apache.org/jira/browse/WICKET-5603
> which seems to suggest that this problem has been fixed - but I guess it
> hasn't. I'm using Wicket 6.16.0.
> (the workaround suggested in the jira comments doesn't apply to me since my
> behaviors are not attached to form components)
>
> Any suggestions on how to catch this exception or for another workaround?
>
> Thanks!
>
>   
>
> 29 Jul 2014 15:44:21,930 WARN  RequestCycleExtra 342:
> ********************************
> 29 Jul 2014 15:44:21,932 WARN  RequestCycleExtra 343: Handling the following
> exception
> org.apache.wicket.core.request.handler.ListenerInvocationNotAllowedException:
> Behavior rejected interface invocation. Component: [WebMarkupContainer
> [Component id = myComponentId]] Behavior:
> com.myDomain.web.myPanel$2@293d7910 Listener: [RequestListenerInterface
> name=IBehaviorListener, method=public abstract void
> org.apache.wicket.behavior.IBehaviorListener.onRequest()]
> 	at
> org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:237)
> 	at
> org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:250)
> 	at
> org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:236)
> 	at
> org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:862)
> 	at
> org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
> 	at
> org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:261)
> 	at
> org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:218)
> 	at
> org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:289)
> 	at
> org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:259)
> 	at
> org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:201)
> 	at
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:282)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> 	at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
> 	at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
> 	at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
> 	at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
> 	at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
> 	at
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
> 	at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
> 	at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395)
> 	at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:250)
> 	at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
> 	at
> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
> 	at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> 	at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> 	at java.lang.Thread.run(Thread.java:662)
> 29 Jul 2014 15:44:21,933 WARN  RequestCycleExtra 344:
> ********************************
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Getting-intermittent-ListenerInvocationNotAllowedException-with-AjaxEventBehavior-tp4666782.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org