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

AbstractHttpSessionStore.bind throws null pointer exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.4.13
    • None
    • None

    Description

      The method gets a n HttpSession, but does not check for null before it uses it.

      HttpSession httpSession = getHttpSession(webRequest);
      // register an unbinding listener for cleaning up
      String applicationKey = application.getApplicationKey();
      httpSession.setAttribute("Wicket:SessionUnbindingListener-" + applicationKey,
      ... ...

      The method getHttpSession is allowed to return null and most other places in the code check for null before using the session.

      Stack trace:
      Oct 19, 2010 9:39:30 PM org.apache.wicket.RequestCycle onExceptionLoop
      SEVERE: unexpected exception when handling another exception: null
      java.lang.NullPointerException
      at org.apache.wicket.protocol.http.AbstractHttpSessionStore.bind(AbstractHttpSessionStore.java:144)
      at org.apache.wicket.Session.bind(Session.java:422)
      at org.apache.wicket.Page.onBeforeRender(Page.java:1537)
      at org.apache.wicket.Component.internalBeforeRender(Component.java:1071)
      at org.apache.wicket.Component.beforeRender(Component.java:1105)
      at org.apache.wicket.Component.prepareForRender(Component.java:2292)
      at org.apache.wicket.Page.prepareForRender(Page.java:1521)
      at org.apache.wicket.Component.prepareForRender(Component.java:2329)
      at org.apache.wicket.Page.renderPage(Page.java:892)

      Attachments

        Activity

          People

            ivaynberg Igor Vaynberg
            ec EC
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified