WebSphere Application Server & Liberty

WebSphere Application Server & Liberty

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

CWWKZ0002E due to "com.ibm.ws.container.service.state.StateChangeException: java.lang.IllegalStateException: Unable to acquire TCCL store lock"

  • 1.  CWWKZ0002E due to "com.ibm.ws.container.service.state.StateChangeException: java.lang.IllegalStateException: Unable to acquire TCCL store lock"

    Posted Wed January 25, 2023 08:45 PM
    I'm using WebSphere liberty 22.0.0.3 and noticed the application startup failed with the message below.

    CWWKZ0002E due to "com.ibm.ws.container.service.state.StateChangeException: java.lang.IllegalStateException: Unable to acquire TCCL store lock"

    By restarting the liberty server, the issue was recovered. But how can we prevent this issue?


    ------------------------------
    Yoshiki Yamada
    IBM Japan
    ------------------------------


  • 2.  RE: CWWKZ0002E due to "com.ibm.ws.container.service.state.StateChangeException: java.lang.IllegalStateException: Unable to acquire TCCL store lock"

    Posted Wed January 25, 2023 08:48 PM

    The error means that the WebSphere classloader component can't get an internal object lock within the limited time due to the lock contention.

    https://github.com/OpenLiberty/open-liberty/blob/20.0.0.3/dev/com.ibm.ws.classloading/src/com/ibm/ws/classloading/internal/ClassLoadingServiceImpl.java#L104

    The default timeout is 15 seconds. So if the issue is frequently happening in your env, please consider to increase the timeout and see if the same issue no longer happens.

    In <wlp_root>/usr/servers/seerver_name/jvm.options, please set the setting below. I think the double value will be a good starting point for tuning.

    -Dcom.ibm.ws.classloading.tcclLockWaitTimeMillis=30000






    ------------------------------
    Yoshiki Yamada
    IBM Japan
    ------------------------------



  • 3.  RE: CWWKZ0002E due to "com.ibm.ws.container.service.state.StateChangeException: java.lang.IllegalStateException: Unable to acquire TCCL store lock"
    Best Answer

    Posted Thu January 26, 2023 10:24 AM
    Yoshiki,

    Your answer is correct on how to avoid the error in 22.0.0.3 and other releases before 22.0.0.6.  Starting in 22.0.0.6, there is a fix to remove contention on the lock that causes this issue with Open Liberty PR 21117.  With that change, timeouts should be a lot more rare since creation of the classloaders should be able to happen in parallel usually.  Usually this problem has been observed in environments with many applications.  Not sure if that is the scenario that you have or not.

    ------------------------------
    Jared Anderson
    ------------------------------