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

"A Cookie name can not be null or empty" when accessing page with WebSocketBehavior

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 8.1.0
    • None
    • None
    • None

    Description

      Due to the change introduced for WICKET-6571, the following exception is reported whenever a class extending WebSocketBehavior is instantiated, and no <cookie-config> was specified in the web.xml :

      java.lang.IllegalArgumentException: A Cookie name can not be null or empty
           at org.apache.wicket.util.cookies.CookieUtils.getSaveKey(CookieUtils.java:188)
           at org.apache.wicket.util.cookies.CookieUtils.getCookie(CookieUtils.java:232)
           at org.apache.wicket.protocol.ws.api.BaseWebSocketBehavior.getSessionId(BaseWebSocketBehavior.java:177)
           at org.apache.wicket.protocol.ws.api.BaseWebSocketBehavior.renderHead(BaseWebSocketBehavior.java:128)
           at org.apache.wicket.Component.internalRenderHead(Component.java:2641)
           at org.apache.wicket.markup.renderStrategy.ChildFirstHeaderRenderStrategy$1.component(ChildFirstHeaderRenderStrategy.java:85)
           at org.apache.wicket.markup.renderStrategy.DeepChildFirstVisitor.visit(DeepChildFirstVisitor.java:96)
           at org.apache.wicket.markup.renderStrategy.DeepChildFirstVisitor.visit(DeepChildFirstVisitor.java:87)
           at org.apache.wicket.markup.renderStrategy.DeepChildFirstVisitor.visit(DeepChildFirstVisitor.java:51)
           at org.apache.wicket.markup.renderStrategy.ChildFirstHeaderRenderStrategy.renderChildHeaders(ChildFirstHeaderRenderStrategy.java:94)
           at org.apache.wicket.markup.renderStrategy.ChildFirstHeaderRenderStrategy.renderHeader(ChildFirstHeaderRenderStrategy.java:57)
           at org.apache.wicket.markup.html.internal.HtmlHeaderContainer.onComponentTagBody(HtmlHeaderContainer.java:171)
           at org.apache.wicket.markup.html.panel.DefaultMarkupSourcingStrategy.onComponentTagBody(DefaultMarkupSourcingStrategy.java:70)
           at org.apache.wicket.Component.internalRenderComponent(Component.java:2479)
           at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1592)
           at org.apache.wicket.Component.internalRender(Component.java:2287)
           at org.apache.wicket.Component.render(Component.java:2218)
           at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1453)
           at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1653)
           at org.apache.wicket.Page.onRender(Page.java:858)
           at org.apache.wicket.markup.html.WebPage.onRender(WebPage.java:126)
           at org.apache.wicket.Component.internalRender(Component.java:2287)
           at org.apache.wicket.Component.render(Component.java:2218)
           at org.apache.wicket.Page.renderPage(Page.java:998)
           at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:124)
           at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:236)
           at org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:202)
           at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:912)
           at org.apache.wicket.request.RequestHandlerExecutor.execute(RequestHandlerExecutor.java:65)
           at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:283)
           at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:253)
           at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:221)
           at org.apache.wicket.protocol.ws.AbstractUpgradeFilter.processRequestCycle(AbstractUpgradeFilter.java:70)
           at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:204)
           at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:286)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
           at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
           at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
           at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
           at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
           at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:770)
           at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415)
           at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
           at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
           at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
           at java.lang.Thread.run(Thread.java:745)
      
      Complete stack:
      
      org.apache.wicket.WicketRuntimeException: Exception in rendering component: [HtmlHeaderContainer [Component id = _header_]]
           at org.apache.wicket.Component.internalRenderComponent(Component.java:2503)
           at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1592)
           at org.apache.wicket.Component.internalRender(Component.java:2287)
           at org.apache.wicket.Component.render(Component.java:2218)
           at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1453)
           at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1653)
           at org.apache.wicket.Page.onRender(Page.java:858)
           at org.apache.wicket.markup.html.WebPage.onRender(WebPage.java:126)
           at org.apache.wicket.Component.internalRender(Component.java:2287)
           at org.apache.wicket.Component.render(Component.java:2218)
           at org.apache.wicket.Page.renderPage(Page.java:998)
           at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:124)
           at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:236)
           at org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:202)
           at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:912)
           at org.apache.wicket.request.RequestHandlerExecutor.execute(RequestHandlerExecutor.java:65)
           at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:283)
           at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:253)
           at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:221)
           at org.apache.wicket.protocol.ws.AbstractUpgradeFilter.processRequestCycle(AbstractUpgradeFilter.java:70)
           at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:204)
      

      It seems in fact that , at least with Tomcat 8.5 and 9, the call returns null, not the default JSESSIONID value.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ilgrosso Francesco Chicchiriccò
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: