Wicket
  1. Wicket
  2. WICKET-5049

Wicket Session may be null in SessionBindingListener after deserialization

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 6.6.0
    • Fix Version/s: 6.7.0, 1.5.11
    • Component/s: wicket
    • Labels:
      None

      Description

      I got this exception when starting my wicket app:

      10:00:24.879 [WARN ] qtp725811713-28 - o.e.j.server.AbstractHttpConnection - /
      java.lang.NullPointerException: null
      at org.apache.wicket.session.HttpSessionStore$SessionBindingListener.valueUnbound(HttpSessionStore.java:469) ~[wicket-core-6.6.0.jar:6.6.0]
      at org.eclipse.jetty.server.session.AbstractSession.unbindValue(AbstractSession.java:519) ~[jetty-all-server-8.1.9.v20130131.jar:8.1.9.v20130131]
      at org.eclipse.jetty.server.session.AbstractSession.clearAttributes(AbstractSession.java:370) ~[jetty-all-server-8.1.9.v20130131.jar:8.1.9.v20130131]
      at org.eclipse.jetty.server.session.AbstractSession.doInvalidate(AbstractSession.java:337) ~[jetty-all-server-8.1.9.v20130131.jar:8.1.9.v20130131]
      at org.eclipse.jetty.server.session.HashedSession.doInvalidate(HashedSession.java:90) ~[jetty-all-server-8.1.9.v20130131.jar:8.1.9.v20130131]
      at org.eclipse.jetty.server.session.AbstractSession.invalidate(AbstractSession.java:327) ~[jetty-all-server-8.1.9.v20130131.jar:8.1.9.v20130131]
      at org.eclipse.jetty.server.session.AbstractSession.access(AbstractSession.java:283) ~[jetty-all-server-8.1.9.v20130131.jar:8.1.9.v20130131]
      at org.eclipse.jetty.server.session.AbstractSessionManager.access(AbstractSessionManager.java:188) ~[jetty-all-server-8.1.9.v20130131.jar:8.1.9.v20130131]
      at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:172) ~[jetty-all-server-8.1.9.v20130131.jar:8.1.9.v20130131]
      at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009) ~[jetty-all-server-8.1.9.v20130131.jar:8.1.9.v20130131]
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) ~[jetty-all-server-8.1.9.v20130131.jar:8.1.9.v20130131]
      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) ~[jetty-all-server-8.1.9.v20130131.jar:8.1.9.v20130131]
      at org.eclipse.jetty.server.Server.handle(Server.java:368) ~[jetty-all-server-8.1.9.v20130131.jar:8.1.9.v20130131]
      at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:488) [jetty-all-server-8.1.9.v20130131.jar:8.1.9.v20130131]
      at org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:53) [jetty-all-server-8.1.9.v20130131.jar:8.1.9.v20130131]
      at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:932) [jetty-all-server-8.1.9.v20130131.jar:8.1.9.v20130131]
      at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:994) [jetty-all-server-8.1.9.v20130131.jar:8.1.9.v20130131]
      at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:640) [jetty-all-server-8.1.9.v20130131.jar:8.1.9.v20130131]
      at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) [jetty-all-server-8.1.9.v20130131.jar:8.1.9.v20130131]
      at org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:72) [jetty-all-server-8.1.9.v20130131.jar:8.1.9.v20130131]
      at org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:264) [jetty-all-server-8.1.9.v20130131.jar:8.1.9.v20130131]
      at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) [jetty-all-server-8.1.9.v20130131.jar:8.1.9.v20130131]
      at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) [jetty-all-server-8.1.9.v20130131.jar:8.1.9.v20130131]
      at java.lang.Thread.run(Thread.java:722) [na:1.7.0_13]

      The line is: wicketSession.onInvalidate(); A simple null check should suffice.

        Activity

        Hide
        Martin Grigorov added a comment -

        SessionBindingListener is saved as an attribute in the http session. This way it is used without requiring a <listener> entry in web.xml of each app. The downside is that it may have been persisted with the sessions and after upgrade to Wicket 6.6.0/1.5.10 it wont have a reference to Wicket's Session.

        Show
        Martin Grigorov added a comment - SessionBindingListener is saved as an attribute in the http session. This way it is used without requiring a <listener> entry in web.xml of each app. The downside is that it may have been persisted with the sessions and after upgrade to Wicket 6.6.0/1.5.10 it wont have a reference to Wicket's Session.
        Hide
        Christoph Leiter added a comment -

        Also happens later while the app is running:

        10:48:31.704 [WARN ] HashSessionScavenger-0 - org.eclipse.jetty.server.session - Problem scavenging sessions
        java.lang.NullPointerException: null
        at org.apache.wicket.session.HttpSessionStore$SessionBindingListener.valueUnbound(HttpSessionStore.java:469) ~[wicket-core-6.6.0.jar:6.6.0]
        at org.eclipse.jetty.server.session.AbstractSession.unbindValue(AbstractSession.java:519) ~[jetty-all-server-8.1.9.v20130131.jar:8.1.9.v20130131]
        at org.eclipse.jetty.server.session.AbstractSession.clearAttributes(AbstractSession.java:370) ~[jetty-all-server-8.1.9.v20130131.jar:8.1.9.v20130131]
        at org.eclipse.jetty.server.session.AbstractSession.doInvalidate(AbstractSession.java:337) ~[jetty-all-server-8.1.9.v20130131.jar:8.1.9.v20130131]
        at org.eclipse.jetty.server.session.HashedSession.doInvalidate(HashedSession.java:90) ~[jetty-all-server-8.1.9.v20130131.jar:8.1.9.v20130131]
        at org.eclipse.jetty.server.session.AbstractSession.timeout(AbstractSession.java:315) ~[jetty-all-server-8.1.9.v20130131.jar:8.1.9.v20130131]
        at org.eclipse.jetty.server.session.HashSessionManager.scavenge(HashSessionManager.java:322) ~[jetty-all-server-8.1.9.v20130131.jar:8.1.9.v20130131]
        at org.eclipse.jetty.server.session.HashSessionManager$2.run(HashSessionManager.java:284) [jetty-all-server-8.1.9.v20130131.jar:8.1.9.v20130131]
        at java.util.TimerThread.mainLoop(Timer.java:555) [na:1.7.0_13]
        at java.util.TimerThread.run(Timer.java:505) [na:1.7.0_13]

        Show
        Christoph Leiter added a comment - Also happens later while the app is running: 10:48:31.704 [WARN ] HashSessionScavenger-0 - org.eclipse.jetty.server.session - Problem scavenging sessions java.lang.NullPointerException: null at org.apache.wicket.session.HttpSessionStore$SessionBindingListener.valueUnbound(HttpSessionStore.java:469) ~ [wicket-core-6.6.0.jar:6.6.0] at org.eclipse.jetty.server.session.AbstractSession.unbindValue(AbstractSession.java:519) ~ [jetty-all-server-8.1.9.v20130131.jar:8.1.9.v20130131] at org.eclipse.jetty.server.session.AbstractSession.clearAttributes(AbstractSession.java:370) ~ [jetty-all-server-8.1.9.v20130131.jar:8.1.9.v20130131] at org.eclipse.jetty.server.session.AbstractSession.doInvalidate(AbstractSession.java:337) ~ [jetty-all-server-8.1.9.v20130131.jar:8.1.9.v20130131] at org.eclipse.jetty.server.session.HashedSession.doInvalidate(HashedSession.java:90) ~ [jetty-all-server-8.1.9.v20130131.jar:8.1.9.v20130131] at org.eclipse.jetty.server.session.AbstractSession.timeout(AbstractSession.java:315) ~ [jetty-all-server-8.1.9.v20130131.jar:8.1.9.v20130131] at org.eclipse.jetty.server.session.HashSessionManager.scavenge(HashSessionManager.java:322) ~ [jetty-all-server-8.1.9.v20130131.jar:8.1.9.v20130131] at org.eclipse.jetty.server.session.HashSessionManager$2.run(HashSessionManager.java:284) [jetty-all-server-8.1.9.v20130131.jar:8.1.9.v20130131] at java.util.TimerThread.mainLoop(Timer.java:555) [na:1.7.0_13] at java.util.TimerThread.run(Timer.java:505) [na:1.7.0_13]

          People

          • Assignee:
            Martin Grigorov
            Reporter:
            Christoph Leiter
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development