Atomikos Forum |
|
Hello,
I have problems configuring Atomikos with Oracle AQ in osgi environment. Environment details: 1. Oracle 11.2.0.1.0 client JARs with patch for Bug 10102373 applied (https://forums.oracle.com/forums/thread.jspa?messageID=10516143) 2. Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production 3. Fuse Apache ServiceMix (4.4.0-fuse-00-43) 4. AtomikosTransactionsEssentials-3.8.0 OSGI bundle Camel Spring-DSL configuration in my bundle: <!-- =============== Oracle AQ CONFIGURATION (XA) =============== --> <bean id="PROPAGATION_REQUIRED" class="org.apache.camel.spring.spi.SpringTransactionPolicy"> <property name="transactionManager" ref="jtaTransactionManager"/> <property name="propagationBehaviorName" value="PROPAGATION_REQUIRED"/> </bean> <bean id="jtaTransactionManager" class="org.springframework.transaction.jta.JtaTransactionManager" depends-on="oracleaqXAConnectionFactory"> <property name="transactionManager" ref="atomikosTransactionManager"/> <property name="userTransaction" ref="atomikosUserTransaction"/> </bean> <bean id="atomikosTransactionManager" class="com.atomikos.icatch.jta.UserTransactionManager" init-method="init" destroy-method="close" depends-on="oracleaqXAConnectionFactory"> <property name="forceShutdown" value="false"/> <!-- when close is called, should we force transactions to terminate or not? --> </bean> <bean id="atomikosUserTransaction" class="com.atomikos.icatch.jta.UserTransactionImp"> <property name="transactionTimeout" value="60"/> </bean> <bean id="connectionFactory" class="com.atomikos.jms.AtomikosConnectionFactoryBean" init-method="init" destroy-method="close" depends-on="oracleaqXAConnectionFactory"> <property name="uniqueResourceName" value="oracleaq25"/> <property name="xaConnectionFactory" ref="oracleaqXAConnectionFactory"/> <property name="localTransactionMode" value ="false" /> <property name="maxPoolSize" value="5"/> <property name="minPoolSize" value="2"/> <property name="reapTimeout" value="0" /> </bean> <bean id="oracleaqXAConnectionFactory" class="oracle.jms.AQjmsFactory" factory-method="getXAQueueConnectionFactory"> <constructor-arg index="0" ref="oracleaqXADataSource" /> </bean> <bean id="oracleaqXADataSource" class="oracle.jdbc.xa.client.OracleXADataSource" destroy-method="close"> <property name="URL" value="..."/> <property name="user" value="..."/> <property name="password" value="..."/> </bean> <bean id="oracleaq" class="org.apache.camel.component.jms.JmsComponent"> <property name="configuration"> <bean class="org.apache.camel.component.jms.JmsConfiguration"> <property name="transacted" value="false"/> </bean> </property> <property name="connectionFactory" ref="connectionFactory" /> <property name="cacheLevelName" value="CACHE_NONE" /> <property name="deliveryPersistent" value="false" /> <property name="maxConcurrentConsumers" value="5" /> <property name="transactionManager" ref="jtaTransactionManager" /> <property name="transacted" value="true" /> </bean> <!-- http://thinkfunctional.blogspot.se/2012/05/atomikos-and-oracle-aq-pooling-problem.html <bean id="atomikosPooledDataSourceBean" class="com.atomikos.jdbc.AtomikosDataSourceBean" init-method="init" destroy-method="close" depends-on="oracleaqXADataSource"> <property name="uniqueResourceName" value="ds4" /> <property name="xaDataSource" ref="oracleaqXADataSource" /> <property name="minPoolSize" value="2"/> <property name="maxPoolSize" value="5"/> </bean> --> <!-- =============== Oracle AQ CONFIGURATION (XA) =============== --> The bundle starts with no problems, at least in the begining, but then, when it is being stopped, I get the following errors: =========================== 2012-09-25 17:22:02,356 | WARN | Timer-1 | ConnectionPool | com.atomikos.logging.JULLogger | - - | atomikos connection pool 'oracleaq25': connection is still in use on pool destroy: atomikos pooled connection for resource oracleaq25 - please check your shutdown sequence to avoid heuristic termination of ongoing transactions! 2012-09-25 17:22:02,359 | WARN | sumer[NOTF_QUEUE | AbstractJmsProxy | com.atomikos.logging.JULLogger | - - | Error delegating call to getTransacted on JMS driver javax.jms.IllegalStateException: JMS-131: Session is closed at oracle.jms.AQjmsError.throwIllegalStateEx(AQjmsError.java:471)[796:oracle-aq-client:11.2.0.1_0] at oracle.jms.AQjmsSession.checkSessionStarted(AQjmsSession.java:4736)[796:oracle-aq-client:11.2.0.1_0] at oracle.jms.AQjmsSession.getTransacted(AQjmsSession.java:955)[796:oracle-aq-client:11.2.0.1_0] at sun.reflect.GeneratedMethodAccessor151.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_27-ea] at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_27-ea] at com.atomikos.jms.AtomikosJmsXaSessionProxy.invoke(AtomikosJmsXaSessionProxy.java:195)[797:com.atomikos.transactions-osgi:3.8.0] at $Proxy72.getTransacted(Unknown Source)[797:com.atomikos.transactions-osgi:3.8.0] at org.springframework.jms.listener.AbstractMessageListenerContainer.commitIfNecessary(AbstractMessageListenerContainer.java:571)[66:org.springframework.jms:3.0.5.RELEASE] at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:358)[66:org.springframework.jms:3.0.5.RELEASE] at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:243)[66:org.springframework.jms:3.0.5.RELEASE] at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1058)[66:org.springframework.jms:3.0.5.RELEASE] at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1050)[66:org.springframework.jms:3.0.5.RELEASE] at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:947)[66:org.springframework.jms:3.0.5.RELEASE] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)[:1.6.0_27-ea] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)[:1.6.0_27-ea] at java.lang.Thread.run(Thread.java:662)[:1.6.0_27-ea] =========================== The consequent bundle start fails with another error: =========================== 2012-09-25 16:55:42,148 | ERROR | tenderThread-114 | ContextLoaderListener | BundleApplicationContextListener | 60 - org.springframework.osgi.extender - 1.2.1 | Application context refresh failed (OsgiBundleXmlApplicationContext(bundle=endpoint-adapter-cashdistribution-internal, config=osgibundle:/META-INF/spring/*.xml)) org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'connectionFactory' defined in URL [bundle://789.37:0/META-INF/spring/camel-context.xml]: Invocation of init method failed; nested exception is com.atomikos.jms.AtomikosJMSException: Cannot initialize AtomikosConnectionFactoryBean at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)[43:org.springframework.beans:3.0.5.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)[43:org.springframework.beans:3.0.5.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)[43:org.springframework.beans:3.0.5.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)[43:org.springframework.beans:3.0.5.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)[43:org.springframework.beans:3.0.5.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)[43:org.springframework.beans:3.0.5.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)[43:org.springframework.beans:3.0.5.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)[43:org.springframework.beans:3.0.5.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)[45:org.springframework.context:3.0.5.RELEASE] at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69)[57:org.springframework.osgi.core:1.2.1] at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)[57:org.springframework.osgi.core:1.2.1] at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)[57:org.springframework.osgi.core:1.2.1] at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)[57:org.springframework.osgi.core:1.2.1] at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)[60:org.springframework.osgi.extender:1.2.1] at java.lang.Thread.run(Thread.java:662)[:1.6.0_27-ea] Caused by: com.atomikos.jms.AtomikosJMSException: Cannot initialize AtomikosConnectionFactoryBean at com.atomikos.jms.AtomikosJMSException.throwAtomikosJMSException(AtomikosJMSException.java:55) at com.atomikos.jms.AtomikosConnectionFactoryBean.throwAtomikosJMSException(AtomikosConnectionFactoryBean.java:174) at com.atomikos.jms.AtomikosConnectionFactoryBean.init(AtomikosConnectionFactoryBean.java:347) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_27-ea] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[:1.6.0_27-ea] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_27-ea] at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_27-ea] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1544)[43:org.springframework.beans:3.0.5.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1485)[43:org.springframework.beans:3.0.5.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)[43:org.springframework.beans:3.0.5.RELEASE] ... 14 more Caused by: javax.naming.NamingException: Another resource already exists with name oracleaq24 - pick a different name at com.atomikos.util.IntraVmObjectFactory.createReference(IntraVmObjectFactory.java:94) at com.atomikos.jms.AtomikosConnectionFactoryBean.getReference(AtomikosConnectionFactoryBean.java:621) at com.atomikos.jms.AtomikosConnectionFactoryBean.init(AtomikosConnectionFactoryBean.java:337) =========================== In which direction sohlud I move to solve this problem? I tried to follow http://thinkfunctional.blogspot.se/2012/05/atomikos-and-oracle-aq-pooling-problem.html, but then another bunch of errors did occur. Igor |