【发布时间】:2013-07-16 09:15:08
【问题描述】:
我遇到了这个链接错误的问题,我们的项目具有相同的代码并且可以工作:
this.plateformTransactionManager = new DataSourceTransactionManager();
this.plateformTransactionManager.setDataSource(dataSource);
DefaultTransactionDefinition def = new DefaultTransactionDefinition();
def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
TransactionStatus status = plateformTransactionManager.getTransaction(def);
运行时的堆栈跟踪:
java.lang.LinkageError: loader constraint violation: when resolving method org.springframework.jdbc.datasource.DataSourceTransactionManager.getTransaction(Lorg/springframework/transaction/TransactionDefinition;) Lorg/springframework/transaction/TransactionStatus;" the class loader (instance of org/apache/catalina/loader/WebappClassLoader) of the current class, com/as24/referentiel/daos/ExternalUserDAO, and the class loader (instance of rg/apache/catalina/loader/StandardClassLoader) for resolved class, org/springframework/jdbc/datasource/DataSourceTransactionManager, have different Class Objects for the type org/springframework/transaction/TransactionDefinition used in the Signature
我读到这是一个 maven 依赖错误,但我们只在 3.0.7.REALEASE 版本上使用了 Spring
我在网上找不到任何解决方案...
【问题讨论】:
-
你能说明你是如何获得
dataSource的吗?
标签: java spring transactions linkageerror