PicoContainer
  1. PicoContainer
  2. PICO-138

ServletContainer passes null parentContainerRef to LifeCycleContainerBuilder, which throws an NPE

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.0-beta-5
    • Fix Version/s: None
    • Component/s: PicoContainer (Java)
    • Labels:
      None
    • Number of attachments :
      1

      Description

      ServletContainerListener (line 52) does

      containerBuilder.buildContainer(containerRef, null, context);

      But LifeCycleContainerBuilder.buildContainer(containerRef, parentContainerRef, context) does

      parentContainerRef.get();

      on line 24. So in its current state, an NPE is thrown when the ServletContext is initialised.

      I think a simple null check in LifeCycleContainerBuilder.buildContainer is the way to go. See patch.

        Activity

        Hide
        James Fairbairn added a comment -

        patch to check for null parent container reference. we should be able to instantiate a container given a null parent container reference (especially as the servlet code tries to do just that!)

        Show
        James Fairbairn added a comment - patch to check for null parent container reference. we should be able to instantiate a container given a null parent container reference (especially as the servlet code tries to do just that!)
        James Fairbairn made changes -
        Field Original Value New Value
        Attachment nullCheck.patch.txt [ 11419 ]
        Hide
        Aslak Hellesøy added a comment -

        This patch seems to be out of date with CVS HEAD. The null check was applied a few days ago (NANO-38).

        Please make sure you're CVS uptodate before reporting bugs.

        Show
        Aslak Hellesøy added a comment - This patch seems to be out of date with CVS HEAD. The null check was applied a few days ago ( NANO-38 ). Please make sure you're CVS uptodate before reporting bugs.
        Aslak Hellesøy made changes -
        Assignee Aslak Hellesoy [ rinkrank ]
        Resolution Won't Fix [ 2 ]
        Status Open [ 1 ] Closed [ 6 ]

          People

          • Assignee:
            Aslak Hellesøy
            Reporter:
            James Fairbairn
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: