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
  • 1.  WAS 9.0.5.20 LinkageError with Spring-tx 5.3.31 and com/ibm/websphere/uow/UOWSynchronizationRegistry

    Posted Wed October 30, 2024 02:37 PM
    Edited by Rafael Escudero Thu October 31, 2024 01:00 PM

    After upgrading to Spring 5 I started seeing this error when the app makes use of spring-tx.

    Here is the exception that I see:

    org.springframework.transaction.TransactionSystemException: UOWManager transaction processing failed; 
    nested exception is com.ibm.wsspi.uow.UOWException: 
    java.lang.LinkageError: com/ibm/websphere/uow/UOWSynchronizationRegistry.registerInterposedSynchronization(Ljavax/transaction/Synchronization;)V 
    (loaded from file:/<redacted>/WAS/9.0/binary/plugins/com.ibm.ws.runtime.jar by 
    org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@ed722f7b[com.ibm.ws.runtime:10.0.0(id=146)]) 
    called from class org.springframework.transaction.jta.WebSphereUowTransactionManager$UOWActionAdapter 
    (loaded from file:/<redacted>/WAS/9.0/apps/<redacted_app_path>/application.war/WEB-INF/lib/spring-tx-5.3.31.jar by 
    com.ibm.ws.classloader.CompoundClassLoader@b97b3092[appwar:application]
       Parent: com.ibm.ws.classloader.ProtectionClassLoader@24a04f35
       Delegation Mode: PARENT_LAST).
        at org.springframework.transaction.jta.WebSphereUowTransactionManager.execute(WebSphereUowTransactionManager.java:313)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:417)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:241)
        at com.sun.proxy.$Proxy119.<redacted_function_call>(Unknown Source)

    I have tried changing the delegation mode to parent_first in app level and module level, and then back and forth but no luck.

    Anyone got any pointers that I could try here?
    Thanks!

    WAS version 9.0.5.20

    java version 1.8.0_411, java runtime version = 8.0.8.25



    ------------------------------
    Rafael Escudero
    ------------------------------



  • 2.  RE: WAS 9.0.5.20 LinkageError with Spring-tx 5.3.31 and com/ibm/websphere/uow/UOWSynchronizationRegistry

    Posted Thu October 31, 2024 07:38 AM

    Without seeing a trace, I would expect that your application includes JEE libraries that conflict with those in tWAS.  Exclude those libraries and the problem should go away.

    Brian



    ------------------------------
    Brian S Paskin
    Sr. Technology Engineer
    IBM Cloud Engineering
    ------------------------------



  • 3.  RE: WAS 9.0.5.20 LinkageError with Spring-tx 5.3.31 and com/ibm/websphere/uow/UOWSynchronizationRegistry

    Posted Thu October 31, 2024 12:41 PM

    Hi Brian. 

    Thanks for your reply. I however think this is not the case, as the conflict seems to be with a WAS class directly and the Spring class
    Namely: com.ibm.websphere.uow.UOWSynchronizationRegistry 

    and org.springframework.transaction.jta.WebSphereUowTransactionManager
    loaded by different ClassLoaders.

    Nonetheless I did see other people with LinkageException problems that had conflict with JTA. I excluded that, but didn't have any effect.

    Do you know which specific Java EE classes could be conflicting here?

    Thanks!



    ------------------------------
    Rafael Escudero
    ------------------------------



  • 4.  RE: WAS 9.0.5.20 LinkageError with Spring-tx 5.3.31 and com/ibm/websphere/uow/UOWSynchronizationRegistry

    Posted Thu October 31, 2024 01:10 PM

     I always recommend removing all JEE libraries in the application because they can cause problems in a multi classloader situation.  I believe the default is parent last, but you could also make tWAS use a single classloader.  Without a trace, I cannot tell you which classes may be causing the issue.  Either that or change your code to use JEE and then not have issues in the future when you upgrade to another version of tWAS/Liberty/Other JEE platform.  

    Brian



    ------------------------------
    Brian S Paskin
    Sr. Technology Engineer
    IBM Cloud Engineering
    ------------------------------



  • 5.  RE: WAS 9.0.5.20 LinkageError with Spring-tx 5.3.31 and com/ibm/websphere/uow/UOWSynchronizationRegistry

    Posted Thu December 12, 2024 04:08 PM

    Hi Brian, sorry for a very late reply.

    Your suggestion was accurate, we had some Apache Geronimo dependencies lying around, conflicting with WAS'.

    Removing those solved this particular issue.

    Thank you very much!

    Rafael.



    ------------------------------
    Rafael Escudero
    ------------------------------