gpt4 book ai didi

java - TransactionSynchronization.afterCompletion 中出现 IncompleteClassChangeError

转载 作者:行者123 更新时间:2023-12-01 04:47:27 25 4
gpt4 key购买 nike

每次我用 JmsTemplate 发送消息时都会抛出异常。 (我使用Spring 3.0.5.RELEASE)。我找不到不兼容的类!

我的类路径中的 Spring jar:

Spring jars in my class path

错误日志:

springframework.transaction.support.TransactionSynchronizationUtils.invokeAfterCompletion(136) | TransactionSynchronization.afterCompletion threw exception
java.lang.IncompatibleClassChangeError: Class org.springframework.jms.connection.JmsResourceHolder does not implement the requested interface org.springframework.transaction.support.ResourceHolder
at org.springframework.transaction.support.ResourceHolderSynchronization.afterCompletion(ResourceHolderSynchronization.java:105)
at org.springframework.transaction.support.TransactionSynchronizationUtils.invokeAfterCompletion(TransactionSynchronizationUtils.java:133)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.invokeAfterCompletion(AbstractPlatformTransactionManager.java:904)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerAfterCompletion(AbstractPlatformTransactionManager.java:879)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:707)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:632)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:314)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621)
at ...

最佳答案

JmsResourceHandler 扩展 org.springframework.transaction.support.ResourceHolderSupport;和 ResourceHolderSupport 实现 ResourceHolder。

ResourceHolderSupport 位于两个 jar 中:

  • Spring-dao-2.0.8
  • Spring-tx-3.0.5.Release

我通过使用Spring-orm-3.0.5.Release解决了这个问题,而不是spring-hibernate3-2.0.8,。

关于java - TransactionSynchronization.afterCompletion 中出现 IncompleteClassChangeError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15597909/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com