简体   繁体   中英

JMS EntityManager Error

I have an application running on JBoss 6.4 that uses JMS queues. When this application is deployed the first time everything works as expected, but if I redeploy without restarting the server I get the following stacktrace.

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

I know glassfish has had issues with this, but has anyone running jboss / hornetq seen this before?

I don't believe this has anything to do with HornetQ. I suspect you will be better off by posting this issue on JPA forum.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM