Geronimo
  1. Geronimo
  2. GERONIMO-3528

Cannot lookup JNDI context inside some servlet event listeners.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.1, 2.0.1
    • Fix Version/s: 2.0.3, 2.1
    • Component/s: naming
    • Security Level: public (Regular issues)
    • Labels:
      None

      Description

      In some servlet event listeners, JNDI context lookup fails.
      I encountered this issue while testing the following use case:

      • When http session has became invalid by timeout, web container automatically updates the logoff datetime to database system.

      So I have made sample application to reproduce this issue and the tested results.
      This stack trace is one of NG results:
      16:23:35,661 ERROR [[/examples]] Session event listener threw exception
      java.lang.NullPointerException
      at org.apache.xbean.naming.context.ContextFlyweight.lookup(ContextFlyweight.java:44)
      at org.apache.xbean.naming.context.ContextFederation.getFederatedBinding(ContextFederation.java:71)
      at org.apache.xbean.naming.context.AbstractFederatedContext.getBinding(AbstractFederatedContext.java:63)
      at org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContext.java:129)
      at org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContext.java:611)
      at org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContext.java:152)
      at org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContext.java:597)
      at javax.naming.InitialContext.lookup(InitialContext.java:351)
      at examples.DBConnector.testConnection(DBConnector.java:26)
      at examples.HttpSessionListenerImpl.sessionDestroyed(HttpSessionListenerImpl.java:15)
      at org.apache.catalina.session.StandardSession.expire(StandardSession.java:702)
      at org.apache.catalina.session.StandardSession.isValid(StandardSession.java:592)
      at org.apache.catalina.session.ManagerBase.processExpires(ManagerBase.java:682)
      at org.apache.catalina.session.ManagerBase.backgroundProcess(ManagerBase.java:667)
      at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1316)
      at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
      at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
      at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
      at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
      at java.lang.Thread.run(Thread.java:595)

      If Geronimo v1.1, the stack trace is:
      [ERROR] HttpSession - SystemDatabase doesn't have been lookuped from JNDI Context.
      javax.naming.NameNotFoundException: comp/env/jdbc/SystemDatasource
      at org.apache.geronimo.naming.java.RootContext.lookup(RootContext.java:45)
      at javax.naming.InitialContext.lookup(InitialContext.java:351)
      at examples.DBConnector.testConnection(DBConnector.java:26)
      at examples.HttpSessionListenerImpl.sessionDestroyed(HttpSessionListenerImpl.java:15)
      at org.apache.catalina.session.StandardSession.expire(StandardSession.java:685)
      at org.apache.catalina.session.StandardSession.isValid(StandardSession.java:577)
      at org.apache.catalina.session.ManagerBase.processExpires(ManagerBase.java:678)
      at org.apache.catalina.session.ManagerBase.backgroundProcess(ManagerBase.java:663)
      at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1283)
      at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1568)
      at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1577)
      at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1577)
      at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1557)
      at java.lang.Thread.run(Thread.java:595)

      1. TestedResults2_including_G3667.html
        2 kB
        Kan Ogawa
      2. TestedResults_including_G3667.html
        2 kB
        Kan Ogawa
      3. TestedResults.html
        0.9 kB
        Kan Ogawa
      4. examples.war
        14 kB
        Kan Ogawa

        Issue Links

          Activity

          Kan Ogawa created issue -
          Kan Ogawa made changes -
          Field Original Value New Value
          Attachment examples.war [ 12367423 ]
          Kan Ogawa made changes -
          Attachment TestedResults.html [ 12367424 ]
          Kan Ogawa made changes -
          Link This issue relates to GERONIMO-1633 [ GERONIMO-1633 ]
          Kan Ogawa made changes -
          Link This issue relates to GERONIMO-1633 [ GERONIMO-1633 ]
          Jarek Gawor made changes -
          Assignee Jarek Gawor [ gawor@mcs.anl.gov ]
          Jarek Gawor made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 2.0.x [ 12312601 ]
          Fix Version/s 2.1 [ 12312602 ]
          Kan Ogawa made changes -
          Status Resolved [ 5 ] Reopened [ 4 ]
          Resolution Fixed [ 1 ]
          Kan Ogawa made changes -
          Attachment TestedResults_including_G3667.html [ 12371285 ]
          Kan Ogawa made changes -
          Link This issue is related to GERONIMO-3667 [ GERONIMO-3667 ]
          Kan Ogawa made changes -
          Attachment TestedResults2_including_G3667.html [ 12371457 ]
          Jarek Gawor made changes -
          Resolution Fixed [ 1 ]
          Status Reopened [ 4 ] Closed [ 6 ]
          Joe Bohn made changes -
          Fix Version/s 2.0.3 [ 12313315 ]
          Fix Version/s 2.0.x [ 12312601 ]

            People

            • Assignee:
              Jarek Gawor
              Reporter:
              Kan Ogawa
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development