WebSphere Application Server & Liberty

 View Only
  • 1.  WAS 9.0.5.20 LinkageError with Spring-tx 5.3.31 and com/ibm/websphere/uow/UOWSynchronizationRegistry

    Posted 22 days ago
    Edited by Rafael Escudero 21 days ago

    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 21 days ago

    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 21 days ago

    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 21 days ago

     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
    ------------------------------