HotswapProjects / HotswapAgent

Java unlimited redefinition of classes at runtime.
GNU General Public License v2.0
2.36k stars 493 forks source link

Spring transaction problem on 0.3 version #91

Closed hedonCZ closed 9 years ago

hedonCZ commented 9 years ago

In WAR application deployed to Tomcat 7.0.63.

Gets error when one service call another service which both are marked @Transactional. Simplified stack trace:

org.springframework.transaction.IllegalTransactionStateException: Pre-bound JDBC Connection found! JpaTransactionManager does not support running within DataSourceTransacti
onManager if told to manage the DataSource itself. It is recommended to use a single JpaTransactionManager for all transactions on a single DataSource, no matter whether JP
A or JDBC access.
        at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:359) ~[spring-orm-4.0.8.RELEASE.jar:4.0.8.RELEASE]
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373) ~[spring-tx-4.0.8.RELEASE.
jar:4.0.8.RELEASE]
        at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:420) [spring-tx-4.0.8.RELEASE.jar
:4.0.8.RELEASE]
        at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:257) [spring-tx-4.0.8.RELEASE.jar:4.0.
8.RELEASE]
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) [spring-tx-4.0.8.RELEASE.jar:4.0.8.RELEASE]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) [spring-aop-4.0.8.RELEASE.jar:4.0.8.RELEASE]
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) [spring-aop-4.0.8.RELEASE.jar:4.0.8.RELEASE]

Here I provides dependency:tree for WAR archive where problem occurs:

[INFO] |  |  +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] |  |  +- org.apache.pdfbox:pdfbox:jar:1.8.8:compile
[INFO] |  |  |  +- org.apache.pdfbox:fontbox:jar:1.8.8:compile
[INFO] |  |  |  \- org.apache.pdfbox:jempbox:jar:1.8.8:compile
[INFO] |  |  +- org.hibernate:hibernate-validator:jar:5.0.3.Final:compile
[INFO] |  |  |  \- com.fasterxml:classmate:jar:1.0.0:compile
[INFO] |  |  \- org.springframework.social:spring-social-linkedin:jar:1.0.1.RELEASE:compile
[INFO] |  |     +- com.fasterxml.jackson.core:jackson-annotations:jar:2.3.4:compile
[INFO] |  |     +- com.fasterxml.jackson.core:jackson-core:jar:2.3.4:compile
[INFO] |  |     +- com.fasterxml.jackson.core:jackson-databind:jar:2.3.4:compile
[INFO] |  |     +- org.springframework.social:spring-social-core:jar:1.1.2.RELEASE:compile
[INFO] |  |     \- org.springframework.social:spring-social-config:jar:1.1.2.RELEASE:compile
[INFO] |  |        \- org.springframework.social:spring-social-web:jar:1.1.2.RELEASE:compile
[INFO] |  |           \- javax.inject:javax.inject:jar:1:compile
[INFO] |  +- com.mysema.querydsl:querydsl-jpa:jar:3.6.2:compile
[INFO] |  |  \- com.mysema.querydsl:querydsl-core:jar:3.6.2:compile
[INFO] |  |     +- com.google.guava:guava:jar:17.0:compile
[INFO] |  |     +- com.google.code.findbugs:jsr305:jar:2.0.3:compile
[INFO] |  |     +- com.mysema.commons:mysema-commons-lang:jar:0.2.4:compile
[INFO] |  |     \- com.infradna.tool:bridge-method-annotation:jar:1.13:compile
[INFO] |  +- com.thoughtworks.xstream:xstream:jar:1.4.8:compile
[INFO] |  |  +- xmlpull:xmlpull:jar:1.1.3.1:compile
[INFO] |  |  \- xpp3:xpp3_min:jar:1.1.4c:compile
[INFO] |  +- commons-beanutils:commons-beanutils:jar:1.9.2:compile
[INFO] |  |  \- commons-collections:commons-collections:jar:3.2.1:compile
[INFO] |  +- commons-io:commons-io:jar:2.4:compile
[INFO] |  +- commons-lang:commons-lang:jar:2.6:runtime
[INFO] |  +- org.apache.commons:commons-lang3:jar:3.1:compile
[INFO] |  +- org.apache.httpcomponents:httpclient:jar:4.3.6:compile
[INFO] |  |  +- org.apache.httpcomponents:httpcore:jar:4.3.3:compile
[INFO] |  |  \- commons-codec:commons-codec:jar:1.7:compile
[INFO] |  +- org.hibernate:hibernate-core:jar:4.3.7.Final:compile
[INFO] |  |  +- org.jboss.logging:jboss-logging:jar:3.1.3.GA:compile
[INFO] |  |  +- org.jboss.logging:jboss-logging-annotations:jar:1.2.0.Beta1:compile
[INFO] |  |  +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:jar:1.0.0.Final:compile
[INFO] |  |  +- dom4j:dom4j:jar:1.6.1:compile
[INFO] |  |  +- org.hibernate.common:hibernate-commons-annotations:jar:4.0.5.Final:compile
[INFO] |  |  +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile
[INFO] |  |  +- org.javassist:javassist:jar:3.18.1-GA:compile
[INFO] |  |  +- antlr:antlr:jar:2.7.7:compile
[INFO] |  |  \- org.jboss:jandex:jar:1.1.0.Final:compile
[INFO] |  +- org.hibernate:hibernate-entitymanager:jar:4.3.7.Final:compile
[INFO] |  +- org.jsoup:jsoup:jar:1.6.3:compile
[INFO] |  +- org.modelmapper:modelmapper:jar:0.7.3:compile
[INFO] |  +- org.quartz-scheduler:quartz:jar:2.2.1:compile
[INFO] |  |  \- c3p0:c3p0:jar:0.9.1.1:compile
[INFO] |  +- org.springframework:spring-context:jar:4.0.8.RELEASE:compile
[INFO] |  +- org.springframework:spring-context-support:jar:4.0.8.RELEASE:compile
[INFO] |  +- org.springframework:spring-core:jar:4.0.8.RELEASE:compile
[INFO] |  +- org.springframework:spring-jdbc:jar:4.0.8.RELEASE:compile
[INFO] |  |  \- org.springframework:spring-tx:jar:4.0.8.RELEASE:compile
[INFO] |  +- org.springframework:spring-web:jar:4.0.8.RELEASE:compile
[INFO] |  +- org.springframework.data:spring-data-jpa:jar:1.6.4.RELEASE:compile
[INFO] |  |  +- org.springframework.data:spring-data-commons:jar:1.8.4.RELEASE:compile
[INFO] |  |  +- org.springframework:spring-orm:jar:4.0.8.RELEASE:compile
[INFO] |  |  \- org.aspectj:aspectjrt:jar:1.8.4:compile
[INFO] |  +- org.springframework.security:spring-security-core:jar:3.2.5.RELEASE:compile
[INFO] |  \- org.springframework.ws:spring-ws-core:jar:2.2.1.RELEASE:compile
[INFO] |     +- commons-logging:commons-logging:jar:1.1.3:compile
[INFO] |     +- org.springframework.ws:spring-xml:jar:2.2.0.RELEASE:compile
[INFO] |     \- org.springframework:spring-oxm:jar:4.0.8.RELEASE:compile
[INFO] +- com.liferay.portal:portal-service:jar:6.2.1:compile
[INFO] +- com.liferay.portal:util-java:jar:6.2.1:compile
[INFO] +- javax.mail:mail:jar:1.4.7:provided
[INFO] +- javax.servlet:javax.servlet-api:jar:3.0.1:provided
[INFO] +- org.postgresql:postgresql:jar:9.3-1102-jdbc41:provided
[INFO] +- org.springframework:spring-test:jar:4.0.8.RELEASE:test
[INFO] +- org.springframework:spring-webmvc:jar:4.0.8.RELEASE:compile
[INFO] |  +- org.springframework:spring-beans:jar:4.0.8.RELEASE:compile
[INFO] |  \- org.springframework:spring-expression:jar:4.0.8.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-config:jar:3.2.5.RELEASE:compile
[INFO] |  +- aopalliance:aopalliance:jar:1.0:compile
[INFO] |  \- org.springframework:spring-aop:jar:4.0.8.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-web:jar:3.2.5.RELEASE:compile
[INFO] +- ch.qos.logback:logback-classic:jar:1.1.2:compile
[INFO] |  \- ch.qos.logback:logback-core:jar:1.1.2:compile
[INFO] +- junit:junit:jar:4.11:test
[INFO] |  \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- org.codehaus.groovy:groovy-all:jar:2.3.7:test
[INFO] +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] +- org.projectlombok:lombok:jar:1.14.8:provided
[INFO] +- org.slf4j:jcl-over-slf4j:jar:1.7.7:runtime
[INFO] +- org.slf4j:jul-to-slf4j:jar:1.7.7:compile
[INFO] +- org.slf4j:log4j-over-slf4j:jar:1.7.7:runtime
[INFO] +- org.slf4j:slf4j-api:jar:1.7.7:compile
[INFO] \- org.spockframework:spock-spring:jar:0.7-groovy-2.0:test
[INFO]    \- org.spockframework:spock-core:jar:0.7-groovy-2.0:test 
erkieh commented 9 years ago

Does this also happen with version 0.2?

hedonCZ commented 9 years ago

No, with version 0.2 it is OK.