IBM Support

PI70870: ConcurrentModificationException in AppClassLoader when using the global library

Fixes are available

16.0.0.4: WebSphere Application Server Liberty 16.0.0.4
17.0.0.1: WebSphere Application Server Liberty 17.0.0.1
17.0.0.2: WebSphere Application Server Liberty 17.0.0.2
17.0.0.3: WebSphere Application Server Liberty 17.0.0.3
17.0.0.4: WebSphere Application Server Liberty 17.0.0.4
18.0.0.1: WebSphere Application Server Liberty 18.0.0.1
18.0.0.2: WebSphere Application Server Liberty 18.0.0.2
18.0.0.3: WebSphere Application Server Liberty 18.0.0.3
18.0.0.4: WebSphere Application Server Liberty 18.0.0.4
19.0.0.1: WebSphere Application Server Liberty 19.0.0.1
19.0.0.2: WebSphere Application Server Liberty 19.0.0.2
19.0.0.3: WebSphere Application Server Liberty 19.0.0.3
19.0.0.4: WebSphere Application Server Liberty 19.0.0.4
19.0.0.5: WebSphere Application Server Liberty 19.0.0.5
19.0.0.6: WebSphere Application Server Liberty 19.0.0.6
19.0.0.7: WebSphere Application Server Liberty 19.0.0.7
19.0.0.8: WebSphere Application Server Liberty 19.0.0.8
19.0.0.9: WebSphere Application Server Liberty 19.0.0.9
19.0.0.10: WebSphere Application Server Liberty 19.0.0.10
19.0.0.11: WebSphere Application Server Liberty 19.0.0.11
19.0.0.12: WebSphere Application Server Liberty 19.0.0.12
20.0.0.1: WebSphere Application Server Liberty 20.0.0.1
20.0.0.2: WebSphere Application Server Liberty 20.0.0.2
20.0.0.3: WebSphere Application Server Liberty 20.0.0.3
20.0.0.4: WebSphere Application Server Liberty 20.0.0.4
20.0.0.5: WebSphere Application Server Liberty 20.0.0.5
20.0.0.6: WebSphere Application Server Liberty 20.0.0.6
20.0.0.7: WebSphere Application Server Liberty 20.0.0.7
20.0.0.8: WebSphere Application Server Liberty 20.0.0.8
20.0.0.9: WebSphere Application Server Liberty 20.0.0.9
20.0.0.10: WebSphere Application Server Liberty 20.0.0.10
20.0.0.11: WebSphere Application Server Liberty 20.0.0.11
20.0.0.12: WebSphere Application Server Liberty 20.0.0.12

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • When using global shared libraries, this creates a parent
    classloader for all application classloaders.  When class
    transformers (such as JPA entity enhancers) are registered
    with application classloaders, they are inadvertently added
    to the global shared library loader too. This registration
    can occur on one thread for one application, while another
    application on another thread could be loading a class which
    iterates over the registered class transformers.  This would
    result in a ConcurrentModificationException.
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server Liberty                              *
    ****************************************************************
    * PROBLEM DESCRIPTION: ConcurrentModificationException in      *
    *                      AppClassLoader when using the global    *
    *                      library                                 *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    When using a global shared library it is possible that a user
    may see a ConcurrentModificationException during application
    startup - particularly if the user is registering class file
    transformers (class file transformers are registered when using
    certain features, such as jpa-2.1, or other third party
    software, such as Spring).  By default the server will use the
    global library if any files exist in the
    ${shared.config.dir}/lib/global or
    ${server.config.dir}/lib/global directories - otherwise, the
    global library must be defined in the server configuration.
    
    The ConcurrentModificationException will look something like
    this:
    java.util.ConcurrentModificationException
    at
    java.util.ArrayList$Itr.checkForComodification(ArrayList.java:90
    1)
    at java.util.ArrayList$Itr.next(ArrayList.java:851)
    at
    com.ibm.ws.classloading.internal.AppClassLoader.findClass(AppCla
    ssLoader.java:290)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at
    com.ibm.ws.classloading.internal.AppClassLoader.findOrDelegateLo
    adClass(AppClassLoader.java:469)
    at
    com.ibm.ws.classloading.internal.AppClassLoader.loadClass(AppCla
    ssLoader.java:441)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at
    com.ibm.ws.cdi.interfaces.CDIUtils.loadClasses(CDIUtils.java:155
    )
    at
    com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDepl
    oymentArchiveImpl.java:243)
    at
    com.ibm.ws.cdi.impl.weld.WebSphereCDIDeploymentImpl.scan(WebSphe
    reCDIDeploymentImpl.java:523)
    at
    com.ibm.ws.cdi.impl.CDIContainerImpl.applicationStarting(CDICont
    ainerImpl.java:117)
    at
    com.ibm.ws.cdi.liberty.CDIRuntimeImpl.applicationStarting(CDIRun
    timeImpl.java:349)
    at
    com.ibm.ws.container.service.state.internal.ApplicationStateMana
    ger.fireStarting(ApplicationStateManager.java:29)
    at
    com.ibm.ws.container.service.state.internal.StateChangeServiceIm
    pl.fireApplicationStarting(StateChangeServiceImpl.java:51)
    at
    com.ibm.ws.app.manager.module.internal.DeployedAppInfoBase.preDe
    ployApp(DeployedAppInfoBase.java:788)
    at
    com.ibm.ws.app.manager.module.internal.DeployedAppInfoBase.deplo
    yApp(DeployedAppInfoBase.java:815)
    at
    com.ibm.ws.app.manager.war.internal.WARApplicationHandlerImpl.in
    stall(WARApplicationHandlerImpl.java:66)
    at
    com.ibm.ws.app.manager.internal.statemachine.StartAction.execute
    (StartAction.java:141)
    at
    com.ibm.ws.app.manager.internal.statemachine.ApplicationStateMac
    hineImpl.enterState(ApplicationStateMachineImpl.java:1192)
    at
    com.ibm.ws.app.manager.internal.statemachine.ApplicationStateMac
    hineImpl.run(ApplicationStateMachineImpl.java:805)
    at
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExec
    utor.java:1142)
    at
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExe
    cutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    
    This occurs because there are two applications that share the
    global library classloader as a parent.  One application has
    finished registering class file transformers and proceeds to
    load classes as part of it's startup processing.  The second
    application is still configuring the classloaders and attempts
    to register class file transformers with the global shared
    library - this adds a transformer to the global library loader
    while the other loader is iterating over them, resulting in the
    ConcurrentModificationException.
    
    The server really should not be registering class file
    transformers in the global shared library loader, since this
    loader is shared amongst all applications in the server.
    

Problem conclusion

  • The fix for this APAR is to ensure that the server does not
    register class file transformers in the global shared library
    classloader.
    
    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

Comments

APAR Information

  • APAR number

    PI70870

  • 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

    2016-10-18

  • 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

    WAS LIBERTY COR

  • Fixed component ID

    5725L2900

Applicable component levels

  • R855 PSY

       UP

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

Document Information

Modified date:
18 October 2021