使用Websphere 8.5.5进行Spring Boot-UOWManager事务处理失败

时间:2018-10-12 12:36:25

标签: java spring spring-boot websphere

启动Web应用程序时(通过URL)出现此异常,这似乎是JTA依赖性问题,但我无法修复它。这在Tomcat上有效,但在Websphere上无效。

堆栈跟踪

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:/home/parag/IBM/WebSphere/AppServer/plugins/com.ibm.ws.runtime.jar by org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@52adb42a) called from class org.springframework.transaction.jta.WebSphereUowTransactionManager$UOWActionAdapter (loaded from file:/home/parag/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/parag-desktopNode01Cell/eplvc-0_0_5_war.ear/eplvc-0.0.5.war/WEB-INF/lib/spring-tx-4.3.18.RELEASE.jar by 
com.ibm.ws.classloader.CompoundClassLoader@b0248555[appwar:eplvc-0_0_5_war]

Parent: com.ibm.ws.classloader.ProtectionClassLoader@e95e3a61
   Delegation Mode: PARENT_LAST).
    at org.springframework.transaction.jta.WebSphereUowTransactionManager.execute(WebSphereUowTransactionManager.java:300) ~[spring-tx-4.3.18.RELEASE.jar:4.3.18.RELEASE]
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:301) ~[spring-tx-4.3.18.RELEASE.jar:4.3.18.RELEASE]
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) ~[spring-tx-4.3.18.RELEASE.jar:4.3.18.RELEASE]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.18.RELEASE.jar:4.3.18.RELEASE]
    at org.springframework.aop.interceptor.AsyncExecutionInterceptor$1.call(AsyncExecutionInterceptor.java:115) ~[spring-aop-4.3.18.RELEASE.jar:4.3.18.RELEASE]
    at java.util.concurrent.FutureTask.run(FutureTask.java:277) [na:1.8.0]
    at java.lang.Thread.run(Thread.java:811) [na:2.9 (07-25-2018)]
Caused by: com.ibm.wsspi.uow.UOWException: java.lang.LinkageError: com/ibm/websphere/uow/UOWSynchronizationRegistry.registerInterposedSynchronization(Ljavax/transaction/Synchronization;)V (loaded from file:/home/parag/IBM/WebSphere/AppServer/plugins/com.ibm.ws.runtime.jar by org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@52adb42a) called from class org.springframework.transaction.jta.WebSphereUowTransactionManager$UOWActionAdapter (loaded from file:/home/parag/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/parag-desktopNode01Cell/eplvc-0_0_5_war.ear/eplvc-0.0.5.war/WEB-INF/lib/spring-tx-4.3.18.RELEASE.jar by 
com.ibm.ws.classloader.CompoundClassLoader@b0248555[appwar:eplvc-0_0_5_war]

Parent: com.ibm.ws.classloader.ProtectionClassLoader@e95e3a61
   Delegation Mode: PARENT_LAST).
    at com.ibm.ws.uow.embeddable.EmbeddableUOWManagerImpl.runUnderNewUOW(EmbeddableUOWManagerImpl.java:812) ~[com.ibm.ws.runtime.jar:na]
    at com.ibm.ws.uow.embeddable.EmbeddableUOWManagerImpl.runUnderUOW(EmbeddableUOWManagerImpl.java:370) ~[com.ibm.ws.runtime.jar:na]
    at org.springframework.transaction.jta.WebSphereUowTransactionManager.execute(WebSphereUowTransactionManager.java:293) ~[spring-tx-4.3.18.RELEASE.jar:4.3.18.RELEASE]
    ... 6 common frames omitted
Caused by: java.lang.LinkageError: com/ibm/websphere/uow/UOWSynchronizationRegistry.registerInterposedSynchronization(Ljavax/transaction/Synchronization;)V (loaded from file:/home/parag/IBM/WebSphere/AppServer/plugins/com.ibm.ws.runtime.jar by org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@52adb42a) called from class org.springframework.transaction.jta.WebSphereUowTransactionManager$UOWActionAdapter (loaded from file:/home/parag/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/parag-desktopNode01Cell/eplvc-0_0_5_war.ear/eplvc-0.0.5.war/WEB-INF/lib/spring-tx-4.3.18.RELEASE.jar by 
com.ibm.ws.classloader.CompoundClassLoader@b0248555[appwar:eplvc-0_0_5_war]

Parent: com.ibm.ws.classloader.ProtectionClassLoader@e95e3a61
   Delegation Mode: PARENT_LAST).
    at org.springframework.transaction.jta.WebSphereUowTransactionManager$UOWActionAdapter.run(WebSphereUowTransactionManager.java:387) ~[spring-tx-4.3.18.RELEASE.jar:4.3.18.RELEASE]
    at com.ibm.ws.uow.embeddable.EmbeddableUOWManagerImpl.runUnderNewUOW(EmbeddableUOWManagerImpl.java:791) ~[com.ibm.ws.runtime.jar:na]
    ... 8 common frames omitted

**Class path excluded for the sake of brevity and can be provided if required.**

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.iciciprulife.eplvc</groupId>
    <artifactId>eplvc</artifactId>
    <version>0.0.5</version>
    <packaging>war</packaging>

    <name>eplvc</name>
    <description>ICICI Pru Life ePLVC</description>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.15.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
        <log4j2.version>2.8.2</log4j2.version>

    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>


        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>


        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
        </dependency>

        <dependency>
            <groupId>com.jcraft</groupId>
            <artifactId>jsch</artifactId>
            <version>0.1.54</version>
        </dependency>


    </dependencies>
</project>

application.properties

spring.datasource.url=jdbc:mysql://localhost:3306/eplvc?useSSL=false
spring.datasource.username=name
spring.datasource.password=pass
spring.datasource.driver-class-name=com.mysql.jdbc.Driver

spring.jpa.generate-ddl=true
spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect

spring.jpa.properties.hibernate.show_sql=true
spring.jpa.properties.hibernate.use_sql_comments=true
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.properties.hibernate.type=trace
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false

spring.session.store-type=jdbc
spring.session.jdbc.initializer.enabled=true
server.session.timeout=600
spring.session.jdbc.schema=classpath:org/springframework/session/jdbc/schema-mysql.sql

1 个答案:

答案 0 :(得分:1)

我解决了此问题,在Websphere控制台的应用程序服务器> server1>进程定义> Java虚拟机的通用JVM参数中添加了-Dspring.jta.enabled=false