2016-04-26 55 views
0

我有一個在JBoss 6.4上運行的應用程序,它使用JMS隊列。當第一次部署此應用程序時,所有事情都按預期工作,但如果我重新部署而不重新啓動服務器,則會收到以下堆棧跟蹤。JMS EntityManager錯誤

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 

我知道glassfish有這個問題,但有運行jboss/hornetq的人看到過這個嗎?

+0

沒有看完整的日誌就很難理解。你應該檢查日誌,以確保1)舊的應用程序被取消部署2)正常的Spring上下文關閉3)在新的部署EntityManager被初始化正確。 –

回答

0

我不認爲這和HornetQ有什麼關係。我懷疑你在JPA論壇上發佈這個問題會更好。

相關問題