2017-02-28 14 views
0

トランザクションに関連するアクティブMQやDBなどの他のデータソースがあるため、XAトランザクションをサポートするOracle AQを使用しようとしています。私はoracle aq queue1に投稿しようとしました。データソースからXA接続を取得中にNullPointerExceptionが発生して失敗しています。私は、Oracle ojdbc6を使用していますXAトランザクションを使用したOracle AQ JMS接続のフェッチ中にNullPointExceptionが発生しました

、私の豆defintionと私のラクダの青写真の11.2バージョンのするaqapi.jar スニペットは、あなたは私が問題が何であるかを特定する助けてもらえ

<reference id="transactionManager" interface="javax.transaction.TransactionManager" /> 
<reference id="recoverableTxManager" interface="org.apache.geronimo.transaction.manager.RecoverableTransactionManager" availability="mandatory" /> 
<reference id="platformTxManager" interface="org.springframework.transaction.PlatformTransactionManager" availability="mandatory"/> 


<bean id="oracleXaDataSource" class="oracle.jdbc.xa.client.OracleXADataSource" destroy-method="close"> 
    <property name="user" value="dbuser" /> 
    <property name="password" value="dbpassword" /> 
    <property name="URL" value="dburl" /> 
</bean> 

<bean id="connectionFactoryOracleAQ" class="oracle.jms.AQjmsFactory" factory-method="getXAQueueConnectionFactory"> 
    <argument value="oracleXaDataSource" /> 
</bean> 

<bean id="oracleaqJcaPooledConnectionFactory" class="org.apache.activemq.jms.pool.JcaPooledConnectionFactory" init-method="start" 
     destroy-method="stop"> 
    <property name="idleTimeout" value="0"/> 
    <property name="name" value="aq.default"/> 
    <property name="maxConnections" value="1"/> 
    <property name="connectionFactory" ref="connectionFactoryOracleAQ"/> 
    <property name="transactionManager" ref="transactionManager"/> 
</bean> 

<bean id="resourceManager-AQ" class="org.apache.activemq.jms.pool.GenericResourceManager" 
     init-method="recoverResource"> 
    <property name="connectionFactory" ref="connectionFactoryOracleAQ"/> 
    <property name="transactionManager" ref="recoverableTxManager"/> 
    <property name="resourceName" value="aq.default"/> 
    <property name="userName" value="${primary.datasource.user}"/> 
    <property name="password" value="${primary.datasource.password}"/> 
</bean> 

<bean id="oracleaqJmsConfig" class="org.apache.camel.component.jms.JmsConfiguration"> 
    <property name="connectionFactory" ref="oracleaqJcaPooledConnectionFactory"/> 
    <property name="transactionManager" ref="platformTxManager"/> 
    <property name="transacted" value="false"/> 
</bean> 

<bean id="oracleaq" class="org.apache.camel.component.jms.JmsComponent"> 
    <property name="connectionFactory" ref="oracleaqJmsConfig" /> 
</bean> 


<camelContext xmlns="http://camel.apache.org/schema/blueprint"> 
    <route id="route1"> 
     <from uri="vm:route1" /> 
      <log message="Message to the oracle Aq:queue1-- ${body}" /> 
      <to uri="oracleaq:queue:queue1?jmsMessageType=Text" pattern="InOnly"/> 
    </route> 
</camelContext> 

以下の通りです。例外はl

2017-02-27 12:14:11,613 | WARN | loyer-4-thread-1 | PooledConnectionFactory   | 9037 - org.apache.activemq.activemq-osgi - 5.11.0.redhat-621084 | Create pooled connection during start failed. This exception will be ignored. 
javax.jms.JMSException: Error while attempting to add new Connection to the pool 
    at org.apache.activemq.jms.pool.PooledConnectionFactory.createJmsException(PooledConnectionFactory.java:267) 
    at org.apache.activemq.jms.pool.PooledConnectionFactory.createConnection(PooledConnectionFactory.java:226) 
    at org.apache.activemq.jms.pool.PooledConnectionFactory.createConnection(PooledConnectionFactory.java:205) 
    at org.apache.activemq.jms.pool.PooledConnectionFactory.start(PooledConnectionFactory.java:291) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_25] 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_25] 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_25] 
    at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_25] 
    at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:299)[15:org.apache.aries.blueprint.core:1.4.4] 
    at org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:956)[15:org.apache.aries.blueprint.core:1.4.4] 
    at org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:712)[15:org.apache.aries.blueprint.core:1.4.4] 
    at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:824)[15:org.apache.aries.blueprint.core:1.4.4] 
    at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787)[15:org.apache.aries.blueprint.core:1.4.4] 
    at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)[15:org.apache.aries.blueprint.core:1.4.4] 
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)[:1.7.0_25] 
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)[:1.7.0_25] 
    at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)[15:org.apache.aries.blueprint.core:1.4.4] 
    at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:247)[15:org.apache.aries.blueprint.core:1.4.4] 
    at org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:183)[15:org.apache.aries.blueprint.core:1.4.4] 
    at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:682)[15:org.apache.aries.blueprint.core:1.4.4] 
    at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:377)[15:org.apache.aries.blueprint.core:1.4.4] 
    at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:269)[15:org.apache.aries.blueprint.core:1.4.4] 
    at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:294)[15:org.apache.aries.blueprint.core:1.4.4] 
    at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:263)[15:org.apache.aries.blueprint.core:1.4.4] 
    at org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:253)[15:org.apache.aries.blueprint.core:1.4.4] 
    at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:500)[9:org.apache.aries.util:1.1.0] 
    at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:433)[9:org.apache.aries.util:1.1.0] 
    at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(BundleHookBundleTracker.java:725)[9:org.apache.aries.util:1.1.0] 
    at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged(BundleHookBundleTracker.java:463)[9:org.apache.aries.util:1.1.0] 
    at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(BundleHookBundleTracker.java:422)[9:org.apache.aries.util:1.1.0] 
    at org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureAction.java:1127)[org.apache.felix.framework-4.4.1.jar:] 
    at org.apache.felix.framework.util.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:696)[org.apache.felix.framework-4.4.1.jar:] 
    at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:484)[org.apache.felix.framework-4.4.1.jar:] 
    at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4429)[org.apache.felix.framework-4.4.1.jar:] 
    at org.apache.felix.framework.Felix.startBundle(Felix.java:2100)[org.apache.felix.framework-4.4.1.jar:] 
    at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:976)[org.apache.felix.framework-4.4.1.jar:] 
    at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:963)[org.apache.felix.framework-4.4.1.jar:] 
    at io.fabric8.agent.service.Agent$BaseDeployCallback.startBundle(Agent.java:482)[86:io.fabric8.fabric-agent:1.2.0.redhat-621084] 
    at io.fabric8.agent.service.Deployer$3.call(Deployer.java:935)[86:io.fabric8.fabric-agent:1.2.0.redhat-621084] 
    at io.fabric8.agent.service.Deployer$3.call(Deployer.java:930)[86:io.fabric8.fabric-agent:1.2.0.redhat-621084] 
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)[:1.7.0_25] 
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)[:1.7.0_25] 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_25] 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_25] 
    at java.lang.Thread.run(Thread.java:724)[:1.7.0_25] 
Caused by: oracle.jms.AQjmsException: Error creating the db_connection 
    at oracle.jms.AQjmsDBConnMgr.getConnection(AQjmsDBConnMgr.java:625) 
    at oracle.jms.AQjmsDBConnMgr.<init>(AQjmsDBConnMgr.java:458) 
    at oracle.jms.AQjmsXAConnection.<init>(AQjmsXAConnection.java:129) 
    at oracle.jms.AQjmsXAConnectionFactory.createXAConnection(AQjmsXAConnectionFactory.java:212) 
    at org.apache.activemq.jms.pool.XaPooledConnectionFactory.createConnection(XaPooledConnectionFactory.java:79) 
    at org.apache.activemq.jms.pool.PooledConnectionFactory$1.makeObject(PooledConnectionFactory.java:108) 
    at org.apache.activemq.jms.pool.PooledConnectionFactory$1.makeObject(PooledConnectionFactory.java:88) 
    at org.apache.commons.pool.impl.GenericKeyedObjectPool.addObject(GenericKeyedObjectPool.java:1748) 
    at org.apache.activemq.jms.pool.PooledConnectionFactory.createConnection(PooledConnectionFactory.java:222) 
    ... 43 more 
Caused by: java.lang.NullPointerException 
    at oracle.jms.AQjmsGeneralDBConnection.getProviderKey(AQjmsGeneralDBConnection.java:99) 
    at oracle.jms.AQjmsGeneralDBConnection.<init>(AQjmsGeneralDBConnection.java:77) 
    at oracle.jms.AQjmsDBConnMgr.getConnection(AQjmsDBConnMgr.java:541) 
    ... 51 more 
+0

あなたは 'maxConnections'を1より大きい値に設定しようとしましたか? – noMad17

+0

はい、私はしました。私は問題が何かを持っていると思う。下に投稿させてください – Rajesh

答えて

0

私は問題があると思う。 Oracle 11.2クライアントから使用しているaqapi.jarにはバグがあります。クラスAqjmsGeneralDBConnectionは、QAConnectionのm_dbConnオブジェクト(XAConnectionを引数として持つコンストラクタ)を初期化せず、nullのm_dbConnオブジェクトのgetURL()にアクセスしようとしています。私は10.2.0のバージョンからaqapi13.jarを試してみました。それは動作します。

AQjmsGeneralDBConnection(AQjmsDBConnMgr paramAQjmsDBConnMgr, Connection paramConnection, boolean paramBoolean1, boolean paramBoolean2) 
    throws JMSException 
    { 
    this.m_connMgr = paramAQjmsDBConnMgr; 
    this.m_dbConn = paramConnection; 
    this.m_isExternal = paramBoolean1; 
    this.m_force = paramBoolean2; 

    this.providerKey = getProviderKey(); 
    } 


    AQjmsGeneralDBConnection(AQjmsDBConnMgr paramAQjmsDBConnMgr, XAConnection paramXAConnection, boolean paramBoolean1, boolean paramBoolean2) 
    throws JMSException 
    { 
    this.m_connMgr = paramAQjmsDBConnMgr; 
    this.m_xaConn = paramXAConnection; 
    this.m_isExternal = paramBoolean1; 
    this.m_force = paramBoolean2; 

    this.providerKey = getProviderKey(); 
    } 



private String getProviderKey() 
    throws JMSException 
    { 
    try 
    { 
     OracleConnection localOracleConnection = (OracleConnection)this.m_dbConn; 
     **String str1 = localOracleConnection.getURL();** 

     int i = str1.indexOf('@'); 
     String str2; 
     if (i < 0) 
     { 
     if ((!"jdbc:oracle:kprb:".equals(str1)) && (!"jdbc:default:connection:".equals(str1))) { 
      AQjmsError.throwEx(112); 
     } 
     str2 = "jdbc:oracle:kprb:"; 
     } 
     else 
     { 
     str2 = str1.substring(i); 
     } 
     return str2.toUpperCase(); 
    } 
    catch (SQLException localSQLException) 
    { 
     throw new AQjmsException(localSQLException); 
    } 
    } 
関連する問題