You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Emond Papegaaij (JIRA)" <ji...@apache.org> on 2014/03/28 20:21:16 UTC

[jira] [Reopened] (WICKET-5541) NullPointerException in SubscribeAnnotationEventSubscriptionInvoker on remove of component from page

     [ https://issues.apache.org/jira/browse/WICKET-5541?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emond Papegaaij reopened WICKET-5541:
-------------------------------------

      Assignee: Emond Papegaaij  (was: Martin Grigorov)

If the component is removed, the subscription for that component should be removed as well. The if-statement will prevent the NPE, but the added debug statement will continue to be triggered until the page is closed. I'll see if I can come up with a fix next week.

> NullPointerException in SubscribeAnnotationEventSubscriptionInvoker on remove of component from page
> ----------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-5541
>                 URL: https://issues.apache.org/jira/browse/WICKET-5541
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-atmosphere
>    Affects Versions: 6.14.0
>            Reporter: Christian Wellekötter
>            Assignee: Emond Papegaaij
>             Fix For: 7.0.0, 6.15.0
>
>
> Following NullPointerException occurs on atmosphere event subscription, if the component, belonging to this event was removed from page before:
> java.lang.NullPointerException: null
>         at org.apache.wicket.atmosphere.SubscribeAnnotationEventSubscriptionInvoker.invoke(SubscribeAnnotationEventSubscriptionInvoker.java:34) ~[wicket-atmosphere-0.16.jar:0.16]
>         at org.apache.wicket.atmosphere.AtmosphereRequestHandler.invokeMethod(AtmosphereRequestHandler.java:104) ~[wicket-atmosphere-0.16.jar:0.16]
>         at org.apache.wicket.atmosphere.AtmosphereRequestHandler.executeHandlers(AtmosphereRequestHandler.java:81) ~[wicket-atmosphere-0.16.jar:0.16]
>         at org.apache.wicket.atmosphere.AtmosphereRequestHandler.respond(AtmosphereRequestHandler.java:70) ~[wicket-atmosphere-0.16.jar:0.16]
>         at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:862) ~[wicket-core-6.14.0.jar:6.14.0]
>         at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64) ~[wicket-request-6.14.0.jar:6.14.0]
>         at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:261) [wicket-core-6.14.0.jar:6.14.0]
>         at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:218) [wicket-core-6.14.0.jar:6.14.0]
>         at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:289) [wicket-core-6.14.0.jar:6.14.0]
>         at org.apache.wicket.atmosphere.EventBus.post(EventBus.java:372) [wicket-atmosphere-0.16.jar:0.16]
>         at org.apache.wicket.atmosphere.EventBus.postToSingleResource(EventBus.java:348) [wicket-atmosphere-0.16.jar:0.16]
>         at org.apache.wicket.atmosphere.EventBus.post(EventBus.java:323) [wicket-atmosphere-0.16.jar:0.16]
> ...
> If you have got a component on a page with a public  method that has a "Subscribe" annotation, the component / the path to the component gets registered to the corresponding page. But if you remove the component from the page the subscription does not get removed. A following atmosphere event could invoke this exception.
> As a workaround I added a null check in my own SubscribeAnnotationEventSubscriptionInvoker:
> public void invoke(AjaxRequestTarget target, EventSubscription subscription, Object base, AtmosphereEvent event, AjaxRequestInitializer ajaxRequestInitializer) {
>         if (base != null) {
> ...
>         }
> }



--
This message was sent by Atlassian JIRA
(v6.2#6252)