Uploaded image for project: '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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 6.6.0
    • 6.7.0
    • wicket-atmosphere
    • None

    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>
      

      Attachments

        Issue Links

          Activity

            People

              papegaaij Emond Papegaaij
              ceefour Hendy Irawan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: