Return-Path: Delivered-To: apmail-geronimo-activemq-users-archive@www.apache.org Received: (qmail 54342 invoked from network); 23 Nov 2006 09:41:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Nov 2006 09:41:58 -0000 Received: (qmail 9460 invoked by uid 500); 23 Nov 2006 09:42:08 -0000 Delivered-To: apmail-geronimo-activemq-users-archive@geronimo.apache.org Received: (qmail 9255 invoked by uid 500); 23 Nov 2006 09:42:08 -0000 Mailing-List: contact activemq-users-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-users@geronimo.apache.org Delivered-To: mailing list activemq-users@geronimo.apache.org Received: (qmail 9246 invoked by uid 99); 23 Nov 2006 09:42:08 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Nov 2006 01:42:08 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of lists@nabble.com designates 72.21.53.35 as permitted sender) Received: from [72.21.53.35] (HELO talk.nabble.com) (72.21.53.35) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Nov 2006 01:41:54 -0800 Received: from [72.21.53.38] (helo=jubjub.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1GnB5H-0002If-Hn for activemq-users@geronimo.apache.org; Thu, 23 Nov 2006 01:41:31 -0800 Message-ID: <7502364.post@talk.nabble.com> Date: Thu, 23 Nov 2006 01:41:31 -0800 (PST) From: Juergen Mayrbaeurl To: activemq-users@geronimo.apache.org Subject: Re: Problem with Outbound JMS with Jencks XA Transactions In-Reply-To: <7488527.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: juergen.mayrbaeurl@hvb.sozvers.at References: <7488527.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org Logging output to show the problem: Created MBeanServer with ID: 1f1ad4a:10f0fa38af5:-8000:hvb0396:1 RMIConnectorServer started at: service:jmx:rmi://localhost/jndi/rmi://localhost:1098/zpvverst 2006-11-22 13:28:34,866 [main] DEBUG org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource - Adding transactional method [durchfuehrenFuerEmpfaengerDerMeldeneStelle] with attribute [PROPAGATION_REQUIRED,ISOLATION_DEFAULT] 2006-11-22 13:28:36,132 [main] DEBUG org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource - Adding transactional method [versenden] with attribute [PROPAGATION_REQUIRED,ISOLATION_DEFAULT] 2006-11-22 13:28:36,897 [main] DEBUG org.springframework.transaction.interceptor.TransactionInterceptor - Getting transaction for at.sozvers.stp.zpv.bc.verstaend.IVerstaendigungskuvertSender.versenden 2006-11-22 13:28:37,772 [main] DEBUG org.springframework.transaction.interceptor.TransactionInterceptor - Invoking commit for transaction on at.sozvers.stp.zpv.bc.verstaend.IVerstaendigungskuvertSender.versenden 2006-11-22 13:28:37,882 [main] DEBUG org.springframework.transaction.interceptor.TransactionInterceptor - Getting transaction for at.sozvers.stp.zpv.bc.verstaend.IVerstaendigungskuvertSender.versenden 2006-11-22 13:28:38,100 [main] DEBUG org.springframework.transaction.interceptor.RuleBasedTransactionAttribute - Applying rules to determine whether transaction should rollback on java.lang.NullPointerException 2006-11-22 13:28:38,100 [main] DEBUG org.springframework.transaction.interceptor.RuleBasedTransactionAttribute - Winning rollback rule is: null 2006-11-22 13:28:38,116 [main] DEBUG org.springframework.transaction.interceptor.RuleBasedTransactionAttribute - No relevant rollback rule found: applying superclass default 2006-11-22 13:28:38,132 [main] DEBUG org.springframework.transaction.interceptor.TransactionInterceptor - Invoking rollback for transaction on at.sozvers.stp.zpv.bc.verstaend.IVerstaendigungskuvertSender.versenden due to throwable [java.lang.NullPointerException] 2006-11-22 13:28:38,132 [main] ERROR org.springframework.transaction.interceptor.TransactionInterceptor - Application exception overridden by rollback exception java.lang.NullPointerException at org.apache.activemq.ra.ManagedConnectionProxy.createSessionProxy(ManagedConnectionProxy.java:117) at org.apache.activemq.ra.ManagedConnectionProxy.createSession(ManagedConnectionProxy.java:106) at org.springframework.jms.core.JmsTemplate.createSession(JmsTemplate.java:771) at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:424) at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:486) at at.sozvers.stp.zpv.verst.app.JMSKuvertSender.versenden(JMSKuvertSender.java:62) at at.sozvers.stp.zpv.verst.app.JMSKuvertSender.versenden(JMSKuvertSender.java:53) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:287) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176) at $Proxy16.versenden(Unknown Source) at at.sozvers.stp.zpv.verst.app.TestCaseKuvertSenden.testTXMehrfachVersand(TestCaseKuvertSenden.java:88) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) And a second one: Created MBeanServer with ID: 16cf4f9:10f0f5aad90:-8000:hvb0396:1 RMIConnectorServer started at: service:jmx:rmi://localhost/jndi/rmi://localhost:1098/zpvverst 2006-11-22 12:09:00,424 [main] DEBUG org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource - Adding transactional method [durchfuehrenFuerEmpfaengerDerMeldeneStelle] with attribute [PROPAGATION_REQUIRED,ISOLATION_DEFAULT] 2006-11-22 12:09:00,799 [main] DEBUG org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource - Adding transactional method [versenden] with attribute [PROPAGATION_REQUIRED,ISOLATION_DEFAULT] 2006-11-22 12:09:01,534 [main] DEBUG org.springframework.transaction.interceptor.TransactionInterceptor - Getting transaction for at.sozvers.stp.zpv.bc.verstaend.IVerstaendigungskuvertSender.versenden 2006-11-22 12:09:02,440 [main] DEBUG org.springframework.transaction.interceptor.TransactionInterceptor - Invoking commit for transaction on at.sozvers.stp.zpv.bc.verstaend.IVerstaendigungskuvertSender.versenden 2006-11-22 12:09:02,565 [main] DEBUG org.springframework.transaction.interceptor.TransactionInterceptor - Getting transaction for at.sozvers.stp.zpv.bc.verstaend.IVerstaendigungskuvertSender.versenden 2006-11-22 12:09:02,877 [main] DEBUG org.springframework.transaction.interceptor.RuleBasedTransactionAttribute - Applying rules to determine whether transaction should rollback on org.springframework.jms.IllegalStateException: The Session is closed; nested exception is javax.jms.IllegalStateException: The Session is closed 2006-11-22 12:09:02,877 [main] DEBUG org.springframework.transaction.interceptor.RuleBasedTransactionAttribute - Winning rollback rule is: null 2006-11-22 12:09:02,893 [main] DEBUG org.springframework.transaction.interceptor.RuleBasedTransactionAttribute - No relevant rollback rule found: applying superclass default 2006-11-22 12:09:02,893 [main] DEBUG org.springframework.transaction.interceptor.TransactionInterceptor - Invoking rollback for transaction on at.sozvers.stp.zpv.bc.verstaend.IVerstaendigungskuvertSender.versenden due to throwable [org.springframework.jms.IllegalStateException: The Session is closed; nested exception is javax.jms.IllegalStateException: The Session is closed] 2006-11-22 12:09:02,893 [main] ERROR org.springframework.transaction.interceptor.TransactionInterceptor - Application exception overridden by rollback exception org.springframework.jms.IllegalStateException: The Session is closed; nested exception is javax.jms.IllegalStateException: The Session is closed javax.jms.IllegalStateException: The Session is closed at org.apache.activemq.ra.ManagedSessionProxy.getSession(ManagedSessionProxy.java:93) at org.apache.activemq.ra.ManagedSessionProxy.createTextMessage(ManagedSessionProxy.java:275) at at.sozvers.stp.zpv.verst.app.JMSKuvertSender$1.createMessage(JMSKuvertSender.java:66) at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:500) at org.springframework.jms.core.JmsTemplate$3.doInJms(JmsTemplate.java:489) at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:432) at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:486) at at.sozvers.stp.zpv.verst.app.JMSKuvertSender.versenden(JMSKuvertSender.java:62) at at.sozvers.stp.zpv.verst.app.JMSKuvertSender.versenden(JMSKuvertSender.java:53) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:287) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176) at $Proxy16.versenden(Unknown Source) at at.sozvers.stp.zpv.verst.app.TestCaseKuvertSenden.testTXMehrfachVersand(TestCaseKuvertSenden.java:88) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) Kind regards Juergen Juergen Mayrbaeurl wrote: > > We're having problems with Outbound JMS in our application. > > The application is a Spring based Java native application that uses Quartz > to fire triggered jobs that are sending JMS messages to an ActiveMQ > message broker and writing to an Oracle Database with Hibernate in one > transaction. Each job is executing the transaction several times. Jobs get > triggered by Quartz in non concurrent mode. > > Components used: JDK 1.4.2, Spring 1.2.8, Quartz 1.5, Hibernate 3.2 and > Jencks 1.3. > > Unfortunately only the first transaction of a job (sending JMS message and > writting to the database) works correctly. The second transaction of the > job (executed in the same thread generated by Quartz) fails in method > execute() of the JMSTemplate class with NPE, because the returned > ManagedConnectionProxy instance from method createConnection() has a NULL > value for the attribute 'managedConnection'. > > Springs transaction demarcation is used with the > TransactionProxyFactoryBean class. We're using the JMSTemplate method > send(String, MessageCreator) for sending the message to the ActiveMQ > message broker (not embedded). > > We tested sending multiple JMS messages without transactions and the same > setup (see below), too. This works fine. Therefore the problem must come > from the transaction handling. > > Configuration setup looks like: > > > > class="org.jencks.factory.TransactionContextManagerFactoryBean" > abstract="false" singleton="true" lazy-init="default" > autowire="default" dependency-check="default" /> > > class="org.jencks.factory.GeronimoTransactionManagerFactoryBean" > abstract="false" singleton="true" lazy-init="default" > autowire="default" dependency-check="default" /> > > class="org.springframework.transaction.jta.JtaTransactionManager" > abstract="false" singleton="true" lazy-init="default" > autowire="default" dependency-check="default"> > > > > > class="org.enhydra.jdbc.pool.StandardXAPoolDataSource" > destroy-method="shutdown"> > > > destroy-method="shutdown"> > > /> > value="oracle.jdbc.driver.OracleDriver" /> > value="${verst.db.url}" /> > > > > > > > > class="org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTrackingCoordinator"/> > > > class="org.jencks.factory.ConnectionManagerFactoryBean"> > > > > > > > > > > > > > > > > > > > > > > > class="org.apache.activemq.ra.ActiveMQResourceAdapter"> > > ${verst.mq.serverUrl} > > > class="org.apache.activemq.ra.ActiveMQManagedConnectionFactory"> > > > class="org.springframework.jca.support.LocalConnectionFactoryBean"> > ref="jmsManagedConnectionFactory" /> > > > > > > > > > > > > > > > class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> > > > > > > > > at.sozvers.stp.zpv.bc.verstaend.impl.schedule.IVerstaendigungslauf > > > > > > > > > > PROPAGATION_REQUIRED > > > > > > > > > > > > > Kind regards > Juergen > -- View this message in context: http://www.nabble.com/Problem-with-Outbound-JMS-with-Jencks-XA-Transactions-tf2684706.html#a7502364 Sent from the ActiveMQ - User mailing list archive at Nabble.com.