IBM Support

PI29275: A NULLPOINTEREXCEPTION OCCURS WHEN ATTEMPTING TO ADD A SERVLET CONTEXT LISTENER THAT DOES NOT EXIST.

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • When attempting to add a servlet context listener that does
    not exist, a NullPointerException occurs because of a method
    invocation on a null object. This null object is the result
    of not being able to find the listener class that was
    specified as it does not exist.
    
    To reproduce this problem, simply invoke the addListener()
    method on a ServletContext object with a listener class name
    that does not exist. This will result in the following stack
    trace:
    
    com.ibm.ws.webcontainer.webapp.WebApp E
    notifyServletContextCreated SRVE0283E: Exception caught
    while initializing context: java.lang.NullPointerException
    	at
    com.ibm.ws.webcontainer.webapp.WebApp.commonAddListener(WebA
    pp.java:5660)
    	at
    com.ibm.ws.webcontainer.webapp.WebApp.addListener(WebApp.jav
    a:5917)
    	at
    com.ibm.wsspi.webcontainer.facade.ServletContextFacade.addLi
    stener(ServletContextFacade.java:652)
    	at
    com.ibm.ws.webcontainer.test.listener.ServletContextListener
    AddListener.contextInitialized(ServletContextListenerAddList
    ener.java:23)
    	at
    com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCr
    eated(WebApp.java:2223)
    	at
    com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java
    :960)
    	...
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  IBM WebSphere Application Server Full       *
    *                  Profile version 8.5.5 and Liberty Profile   *
    *                  version 8.5.5                               *
    ****************************************************************
    * PROBLEM DESCRIPTION: A java.lang.NullPointerException occurs *
    *                      when attempting to add a listener       *
    *                      programatically that does not exist.    *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    When attempting to add a listener that does not exist, a
    NullPointerException occurs in the logs.
    
    An example of a stack
    trace that will be observed is shown
    below:
    com.ibm.ws.webcontainer.webapp.WebApp E
    notifyServletContextCreated SRVE0283E: Exception caught while
    initializing context: java.lang.NullPointerException
        at
    com.ibm.ws.webcontainer.webapp.WebApp.commonAddListener(WebApp.j
    ava:5660)
        at
    com.ibm.ws.webcontainer.webapp.WebApp.addListener(WebApp.java:59
    17)
        at
    com.ibm.wsspi.webcontainer.facade.ServletContextFacade.addListen
    er(ServletContextFacade.java:652)
        ...
    

Problem conclusion

  • The WebContainer code was modified to fix the
    NullPointerException. A message similar to the following will be
    logged: SRVE8015E: An exception occurred while trying to add a
    listener of type ThisListenerDoesNotExist
    
    The fix for this APAR
    is currently targeted for inclusion in fixpack 8.5.5.5. Please
    refer to the recommended updates page for delivery information:
    http://www.ibm.com/support/docview.wss?rs=180&uid=swg27004980
    

Temporary fix

Comments

APAR Information

  • APAR number

    PI29275

  • Reported component name

    WAS LIBERTY COR

  • Reported component ID

    5725L2900

  • Reported release

    855

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2014-11-10

  • Closed date

    2014-12-11

  • Last modified date

    2014-12-11

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    WAS LIBERTY COR

  • Fixed component ID

    5725L2900

Applicable component levels

  • R855 PSY

       UP

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSD28V","label":"WebSphere Application Server Liberty Core"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"855","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
27 April 2022