JMS EntityManager错误

时间:2016-04-26 16:20:29

标签: java spring jboss hornetq

我在JBoss 6.4上运行了一个使用JMS队列的应用程序。第一次部署此应用程序时,一切都按预期工作,但如果我重新部署而不重新启动服务器,则会得到以下堆栈跟踪。

HQ122001: Unhandled exception thrown from onMessage: org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is java.lang.IllegalStateException: Attempting to execute an operation on a closed EntityManagerFactory.
at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:382) [org.springframework.orm.jar:3.0.5.RELEASE]
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:371) [org.springframework.transaction.jar:3.0.5.RELEASE]
at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:335) [org.springframework.transaction.jar:3.0.5.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:105) [org.springframework.transaction.jar:3.0.5.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) [org.springframework.aop.jar:3.0.5.RELEASE]
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) [org.springframework.aop.jar:3.0.5.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) [org.springframework.aop.jar:3.0.5.RELEASE]
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621) [org.springframework.aop.jar:3.0.5.RELEASE]
at org.naic.nusa.user.service.UserService$$EnhancerByCGLIB$$365b5448.queryLdapForUsername(<generated>) [cglib-nodep.jar:]
at org.naic.nusa.queue.QueueService.checkMessage(QueueService.java:60) [classes:]
at org.naic.nusa.queue.QueueService.access$200(QueueService.java:33) [classes:]
at org.naic.nusa.queue.QueueService$1.onMessage(QueueService.java:239) [classes:]
at org.hornetq.jms.client.JMSMessageListenerWrapper.onMessage(JMSMessageListenerWrapper.java:98)
at org.hornetq.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:1117)
at org.hornetq.core.client.impl.ClientConsumerImpl.access$500(ClientConsumerImpl.java:57)
at org.hornetq.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:1252)
at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:105)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_71]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_71]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_71]
Caused by: java.lang.IllegalStateException: Attempting to execute an operation on a closed EntityManagerFactory.
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.verifyOpen(EntityManagerFactoryDelegate.java:306) [eclipselink.jar:2.4.2.v20130514-5956486]
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:277) [eclipselink.jar:2.4.2.v20130514-5956486]
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:304) [eclipselink.jar:2.4.2.v20130514-5956486]
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:282) [eclipselink.jar:2.4.2.v20130514-5956486]
at org.springframework.orm.jpa.JpaTransactionManager.createEntityManagerForTransaction(JpaTransactionManager.java:400) [org.springframework.orm.jar:3.0.5.RELEASE]
at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:321) [org.springframework.orm.jar:3.0.5.RELEASE]
... 19 more

我知道玻璃鱼有这个问题,但是之前有人看过jboss / hornetq吗?

1 个答案:

答案 0 :(得分:0)

我不相信这与HornetQ有任何关系。我怀疑你会在JPA论坛上发布这个问题会更好。