IBM Support

PI71525: NullPointerException when registering a Custom User Registry that returns a null realm name

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • For WebSphere Application Server Liberty, a
    NullPointerException is raised when the Custom User Registry
    returns null for the realm name.  The exception message is
    as follows,
    
    CWWKE0701E: FrameworkEvent ERROR
    Bundle:com.ibm.ws.security.registry(id=153)
    java.lang.NullPointerException
    at java.util.Hashtable.put(Hashtable.java:505)
    at java.util.Hashtable.putAll(Hashtable.java:579)
    at java.util.Hashtable.<init>(Hashtable.java:245)
    at
    org.apache.felix.scr.impl.manager.AbstractComponentManager.s
    etServiceProperties(AbstractComponentManager.java:1385)
    at
    org.apache.felix.scr.impl.manager.DependencyManager.doInvoke
    BindMethod(DependencyManager.java:1665)
    at
    org.apache.felix.scr.impl.manager.DependencyManager.invokeBi
    ndMethod(DependencyManager.java:1636)
    at
    org.apache.felix.scr.impl.manager.SingleComponentManager.inv
    okeBindMethod(SingleComponentManager.java:370)
    at
    org.apache.felix.scr.impl.manager.DependencyManager$Multiple
    DynamicCustomizer.addedService(DependencyManager.java:319)
    at
    org.apache.felix.scr.impl.manager.DependencyManager$Multiple
    DynamicCustomizer.addedService(DependencyManager.java:295)
    at
    org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.cus
    tomizerAdded(ServiceTracker.java:1215)
    at
    org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.cus
    tomizerAdded(ServiceTracker.java:1136)
    at
    org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTra
    cked.trackAdding(ServiceTracker.java:945)
    at
    org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTra
    cked.track(ServiceTracker.java:881)
    at
    org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.ser
    viceChanged(ServiceTracker.java:1167)
    at
    org.apache.felix.scr.impl.BundleComponentActivator$ListenerI
    nfo.serviceChanged(BundleComponentActivator.java:124)
    at
    org.eclipse.osgi.internal.serviceregistry.FilteredServiceLis
    tener.serviceChanged(FilteredServiceListener.java:109)
    at
    org.eclipse.osgi.internal.framework.BundleContextImpl.dispat
    chEvent(BundleContextImpl.java:915)
    at
    org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEve
    nt(EventManager.java:230)
    at
    org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEv
    entSynchronous(ListenerQueue.java:148)
    at
    org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.pu
    blishServiceEventPrivileged(ServiceRegistry.java:862)
    at
    org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.pu
    blishServiceEvent(ServiceRegistry.java:801)
    at
    org.eclipse.osgi.internal.serviceregistry.ServiceRegistratio
    nImpl.register(ServiceRegistrationImpl.java:127)
    at
    org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.re
    gisterService(ServiceRegistry.java:225)
    at
    org.eclipse.osgi.internal.framework.BundleContextImpl.regist
    erService(BundleContextImpl.java:464)
    at
    org.eclipse.osgi.internal.framework.BundleContextImpl.regist
    erService(BundleContextImpl.java:482)
    at
    org.eclipse.osgi.internal.framework.BundleContextImpl.regist
    erService(BundleContextImpl.java:999)
    at
    com.ibm.ws.security.registry.CustomUserRegistryFactory.regis
    terUserRegistryConfigurations(CustomUserRegistryFactory.java
    :113)
    at
    com.ibm.ws.security.registry.CustomUserRegistryFactory.activ
    ate(CustomUserRegistryFactory.java:97)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
    Method)
    ...
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server Liberty - Security                   *
    ****************************************************************
    * PROBLEM DESCRIPTION: NullPointerException when registering a *
    *                      Custom User Registry that returns a     *
    *                      null realm name                         *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    For WebSphere Application Server Liberty, a NullPointerException
    is raised when the Custom User Registry returns null for the
    realm name.  The exception message is as follows,
    
    CWWKE0701E: FrameworkEvent ERROR
    Bundle:com.ibm.ws.security.registry(id=153)
    java.lang.NullPointerException
    	at java.util.Hashtable.put(Hashtable.java:505)
    	at java.util.Hashtable.putAll(Hashtable.java:579)
    	at java.util.Hashtable.<init>(Hashtable.java:245)
    	at
    org.apache.felix.scr.impl.manager.AbstractComponentManager.setSe
    rviceProperties(AbstractComponentManager.java:1385)
    	at
    org.apache.felix.scr.impl.manager.DependencyManager.doInvokeBind
    Method(DependencyManager.java:1665)
    	at
    org.apache.felix.scr.impl.manager.DependencyManager.invokeBindMe
    thod(DependencyManager.java:1636)
    	at
    org.apache.felix.scr.impl.manager.SingleComponentManager.invokeB
    indMethod(SingleComponentManager.java:370)
    	at
    org.apache.felix.scr.impl.manager.DependencyManager$MultipleDyna
    micCustomizer.addedService(DependencyManager.java:319)
    	at
    org.apache.felix.scr.impl.manager.DependencyManager$MultipleDyna
    micCustomizer.addedService(DependencyManager.java:295)
    	at
    org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customi
    zerAdded(ServiceTracker.java:1215)
    	at
    org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customi
    zerAdded(ServiceTracker.java:1136)
    	at
    org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked
    .trackAdding(ServiceTracker.java:945)
    	at
    org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked
    .track(ServiceTracker.java:881)
    	at
    org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.service
    Changed(ServiceTracker.java:1167)
    	at
    org.apache.felix.scr.impl.BundleComponentActivator$ListenerInfo.
    serviceChanged(BundleComponentActivator.java:124)
    	at
    org.eclipse.osgi.internal.serviceregistry.FilteredServiceListene
    r.serviceChanged(FilteredServiceListener.java:109)
    	at
    org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEv
    ent(BundleContextImpl.java:915)
    	at
    org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(E
    ventManager.java:230)
    	at
    org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventS
    ynchronous(ListenerQueue.java:148)
    	at
    org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publis
    hServiceEventPrivileged(ServiceRegistry.java:862)
    	at
    org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publis
    hServiceEvent(ServiceRegistry.java:801)
    	at
    org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImp
    l.register(ServiceRegistrationImpl.java:127)
    	at
    org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.regist
    erService(ServiceRegistry.java:225)
    	at
    org.eclipse.osgi.internal.framework.BundleContextImpl.registerSe
    rvice(BundleContextImpl.java:464)
    	at
    org.eclipse.osgi.internal.framework.BundleContextImpl.registerSe
    rvice(BundleContextImpl.java:482)
    	at
    org.eclipse.osgi.internal.framework.BundleContextImpl.registerSe
    rvice(BundleContextImpl.java:999)
    	at
    com.ibm.ws.security.registry.CustomUserRegistryFactory.registerU
    serRegistryConfigurations(CustomUserRegistryFactory.java:113)
    	at
    com.ibm.ws.security.registry.CustomUserRegistryFactory.activate(
    CustomUserRegistryFactory.java:97)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    ...
    

Problem conclusion

  • The code was modified to use the default realm of customRealm
    for a custom user registry that returns null as documented in
    the com.ibm.websphere.security.UserRegistry API,
    
    /**
         * Returns the realm of the registry.
         *
         * @return the realm. The realm is a registry-specific
    string indicating
         *         the <i>realm</i> or <i>domain</i> for which this
    registry
         *         applies. For example, for OS400 or AIX this would
    be the
         *         host name of the system whose user registry this
    object
         *         represents.
         *         If null is returned by this method realm defaults
    to the
         *         value of "customRealm".
         * @exception CustomRegistryException if there is any
    registry specific
         *                problem
         * @exception RemoteException as this extends
    java.rmi.Remote
         **/
        public String getRealm()
    
    The fix for this APAR is currently targeted for inclusion in fix
    pack 16.0.0.4.  Please refer to the Recommended Updates page for
    delivery information:
    http://www.ibm.com/support/docview.wss?rs=180&uid=swg27004980
    

Temporary fix

  • Ensure that the Custom User Registry implementation returns a
    non-null realm name from the getRealm method.
    

Comments

APAR Information

  • APAR number

    PI71525

  • Reported component name

    LIBERTY PROFILE

  • Reported component ID

    5724J0814

  • Reported release

    855

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2016-10-31

  • Closed date

    2016-11-03

  • Last modified date

    2016-11-03

  • 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

    LIBERTY PROFILE

  • Fixed component ID

    5724J0814

Applicable component levels

  • R855 PSY

       UP

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"855","Line of Business":{"code":"LOB36","label":"IBM Automation"}}]

Document Information

Modified date:
17 June 2020