Wicket
  1. Wicket
  2. WICKET-5134

java.lang.NullPointerException at org.apache.wicket.markup.html.form.Form.onComponentTag(Form.java:1520) during Atmosphere eventbus.post() if using WebSockets

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 6.6.0
    • Fix Version/s: 6.7.0
    • Component/s: wicket-atmosphere
    • Labels:
      None
    • Environment:

      Description

      If using WebSockets, it always throws the NPE below:

      Unexpected RuntimeException
      
      Last cause: null
      
      Stacktrace
      
      Root cause:
      
      java.lang.NullPointerException
           at org.apache.wicket.markup.html.form.Form.onComponentTag(Form.java:1520)
           at org.apache.wicket.Component.internalRenderComponent(Component.java:2511)
           at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1488)
           at org.apache.wicket.Component.internalRender(Component.java:2370)
           at org.apache.wicket.Component.render(Component.java:2298)
           at org.apache.wicket.ajax.XmlAjaxResponse.writeComponent(XmlAjaxResponse.java:127)
           at org.apache.wicket.ajax.AbstractAjaxResponse.writeComponents(AbstractAjaxResponse.java:214)
           at org.apache.wicket.ajax.AbstractAjaxResponse.writeTo(AbstractAjaxResponse.java:145)
           at org.apache.wicket.ajax.AjaxRequestHandler.respond(AjaxRequestHandler.java:363)
           at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:840)
           at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
           at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:97)
           at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:254)
           at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:211)
           at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:282)
           at org.apache.wicket.atmosphere.EventBus.post(EventBus.java:320)
           at org.apache.wicket.atmosphere.EventBus.postToSingleResource(EventBus.java:297)
           at org.apache.wicket.atmosphere.EventBus.post(EventBus.java:272)
           at com.soluvas.story.impl.StoryManagerImpl.publish(StoryManagerImpl.java:107)
           at id.co.bippo.comment.story.ProductCommentedStoryPoster.createStoriesAndPublish(ProductCommentedStoryPoster.java:71)
           at java.lang.reflect.Method.invoke(Method.java:601)
           at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
           at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
           at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
           at com.google.common.eventbus.AsyncEventBus.access$001(AsyncEventBus.java:34)
           at com.google.common.eventbus.AsyncEventBus$1.run(AsyncEventBus.java:100)
           at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
           at java.lang.Thread.run(Thread.java:722)
      
      display page view
      

      Another stacktrace:

      Unexpected RuntimeException
      
      Last cause: null
      
      Stacktrace
      
      Root cause:
      
      java.lang.NullPointerException
           at org.apache.wicket.markup.html.form.Form.onComponentTag(Form.java:1520)
           at org.apache.wicket.Component.internalRenderComponent(Component.java:2511)
           at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1488)
           at org.apache.wicket.Component.internalRender(Component.java:2370)
           at org.apache.wicket.Component.render(Component.java:2298)
           at org.apache.wicket.ajax.XmlAjaxResponse.writeComponent(XmlAjaxResponse.java:127)
           at org.apache.wicket.ajax.AbstractAjaxResponse.writeComponents(AbstractAjaxResponse.java:214)
           at org.apache.wicket.ajax.AbstractAjaxResponse.writeTo(AbstractAjaxResponse.java:145)
           at org.apache.wicket.ajax.AjaxRequestHandler.respond(AjaxRequestHandler.java:363)
           at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:840)
           at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
           at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:97)
           at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:254)
           at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:211)
           at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:282)
           at org.apache.wicket.atmosphere.EventBus.post(EventBus.java:320)
           at org.apache.wicket.atmosphere.EventBus.postToSingleResource(EventBus.java:297)
           at org.apache.wicket.atmosphere.EventBus.post(EventBus.java:272)
           at com.soluvas.story.impl.StoryManagerImpl.publish(StoryManagerImpl.java:107)
           at id.co.bippo.comment.story.ProductCommentedStoryPoster.createStoriesAndPublish(ProductCommentedStoryPoster.java:71)
           at java.lang.reflect.Method.invoke(Method.java:601)
           at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
           at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
           at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
           at com.google.common.eventbus.AsyncEventBus.access$001(AsyncEventBus.java:34)
           at com.google.common.eventbus.AsyncEventBus$1.run(AsyncEventBus.java:100)
           at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
           at java.lang.Thread.run(Thread.java:722)
      
      display page view
      

      This bug is always reproducible in my configuration.

      It doesn't occur if comet/long-polling is used instead of websockets. Which means setting below will not trigger the bug:

      		<init-param>
      			<param-name>org.atmosphere.useWebSocket</param-name>
      			<param-value>false</param-value>
      		</init-param>
      

        Issue Links

          Activity

          Hide
          Hendy Irawan added a comment - - edited

          Correction: Bug only reproducible on atmosphere-runtime 1.0.12, 1.0.11, 1.0.10.

          Works well on atmosphere-runtime 1.0.8 (the default in wicket-atmosphere 0.8) and 1.0.9.

          Show
          Hendy Irawan added a comment - - edited Correction: Bug only reproducible on atmosphere-runtime 1.0.12, 1.0.11, 1.0.10. Works well on atmosphere-runtime 1.0.8 (the default in wicket-atmosphere 0.8) and 1.0.9.
          Hide
          Hendy Irawan added a comment -
          Show
          Hendy Irawan added a comment - Also reported on https://github.com/Atmosphere/atmosphere/issues/1002
          Hide
          Emond Papegaaij added a comment -

          This was already fixed in WICKET-5084, which is still open because not the entire ticket is fixed.

          Show
          Emond Papegaaij added a comment - This was already fixed in WICKET-5084 , which is still open because not the entire ticket is fixed.
          Hide
          Hendy Irawan added a comment -

          Thanks Emond Papegaaij for the info!

          Show
          Hendy Irawan added a comment - Thanks Emond Papegaaij for the info!

            People

            • Assignee:
              Emond Papegaaij
              Reporter:
              Hendy Irawan
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development