Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-4928

Error adding links to WebSocketRequestHandler

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 6.4.0
    • 6.5.0
    • None

    Description

      I get a nullpointer when trying to add newly created ajax links to the WebSocketRequestHandler because of the lack of a base url. Doing the same with an AjaxRequestTarget works fine. See attached quickstart.

      ERROR - AbstractWebSocketProcessor - An error occurred during processing of a WebSocket message
      java.lang.NullPointerException
      at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.renderHead(AbstractDefaultAjaxBehavior.java:97)
      at org.apache.wicket.ajax.AjaxEventBehavior.renderHead(AjaxEventBehavior.java:79)
      at org.apache.wicket.Component.renderHead(Component.java:2704)
      at org.apache.wicket.ajax.AbstractAjaxResponse$1.component(AbstractAjaxResponse.java:476)
      at org.apache.wicket.ajax.AbstractAjaxResponse$1.component(AbstractAjaxResponse.java:470)
      at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:144)
      at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162)
      at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:123)
      at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:192)
      at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:874)
      at org.apache.wicket.ajax.AbstractAjaxResponse.writeHeaderContribution(AbstractAjaxResponse.java:469)
      at org.apache.wicket.ajax.XmlAjaxResponse.writeComponent(XmlAjaxResponse.java:101)
      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.WebSocketRequestHandler.respond(WebSocketRequestHandler.java:257)
      at org.apache.wicket.protocol.ws.api.AbstractWebSocketProcessor.broadcastMessage(AbstractWebSocketProcessor.java:185)
      at org.apache.wicket.protocol.ws.api.AbstractWebSocketProcessor.onMessage(AbstractWebSocketProcessor.java:89)
      at org.apache.wicket.protocol.ws.jetty.JettyWebSocketProcessor$JettyWebSocket.onMessage(JettyWebSocketProcessor.java:44)
      at org.eclipse.jetty.websocket.WebSocketConnectionRFC6455$WSFrameHandler.onFrame(WebSocketConnectionRFC6455.java:845)
      at org.eclipse.jetty.websocket.WebSocketParserRFC6455.parseNext(WebSocketParserRFC6455.java:359)
      at org.eclipse.jetty.websocket.WebSocketConnectionRFC6455.handle(WebSocketConnectionRFC6455.java:235)
      at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:606)
      at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:46)
      at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:603)
      at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:538)
      at java.lang.Thread.run(Thread.java:680)

      I have a similar kind of problem using wicket-cdi and websockets trying to use request scoped injected beans. I suppose that's natural though but it would be awesome if it worked. (Example not included in the quickstart)

      org.jboss.weld.context.ContextNotActiveException: WELD-001303 No active contexts for scope type javax.enterprise.context.RequestScoped
      at org.jboss.weld.manager.BeanManagerImpl.getContext(BeanManagerImpl.java:590)
      at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:71)

      Attachments

        1. websocket-target-add-link.zip
          25 kB
          Anders Roxenhag

        Activity

          People

            mgrigorov Martin Tzvetanov Grigorov
            roxen Anders Roxenhag
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: