Ich habe eine Anwendung auf JBoss 6.4 ausgeführt, die JMS-Warteschlangen verwendet. Wenn diese Anwendung das erste Mal bereitgestellt wird, funktioniert alles wie erwartet, aber wenn ich erneut bereitstellen, ohne den Server neu zu starten, erhalte ich den folgenden Stacktrace.JMS EntityManager Fehler
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
Ich weiß, Glassfish hat mit diesen Probleme haben, sondern läuft jemand Jboss/HornetQ vorher gesehen?
Ohne das vollständige Protokoll anzusehen, ist es schwer zu verstehen. Sie sollten das Protokoll überprüfen, um sicherzustellen, 1) alte Anwendung wird nicht bereitgestellt 2) Spring Kontext ordnungsgemäß beendet 3) auf New Deploy EntityManager wurde korrekt initialisiert. –