Atomikos Forum

AtomikosConnectionFactoryBean User and Password problem

Hi Team,

We have looped in Atomikos 3.7.2 to be our JTA transaction manager managing global transactions on Tibco EMS resource (send messages on topics)and our database server(to run updates). Our code has been build in Java utilising springs framework and no application server.

We were able to successfully run XA using Atomikos on our DEV TIBCO EMS instance which does not need authentication.
But we now are attempting to use our UAT TIBCO EMS instance which needs the username and password for connectivity and we see an issue here.


Can you please urgently advise us how can we pass the username and password for successfull login. I found a related post but this answers MQ and we are using TIBCO EMS for messaging.

The createConnection(username, password) method in AtomikosConnectionFactoryBean calls the default implementation in Atomikos source code.

default82df.html?community.6.1659.1

Here are snapshot of our spring beans.
=======================================

    <bean id="userCredentialsConnectionFactory"
        class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter">
          <property name="targetConnectionFactory" ref="topicConnectionFactoryBean" />
          <property name="username" value="xxxx" />
        <property name="password" value="xxxx" />
    </bean>

    <bean id="jmsConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiTemplate" ref="jndiTemplate"/>
        <property name="jndiName" value="com.topic.cib.XATopicCF"/>
    </bean>

    <bean id="topicConnectionFactoryBean" class="com.atomikos.jms.AtomikosConnectionFactoryBean" init-method="init" destroy-method="close">
        <property name="uniqueResourceName"><value>TOPIC_BROKER </value></property>
        <property name="xaConnectionFactory"><ref bean="jmsConnectionFactory"/></property>
        <property name="localTransactionMode" value="false"></property>
    </bean>


    <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
        <property name="environment">
        <props>
            <prop key="java.naming.provider.url">jndiName</prop>
            <prop key="java.naming.factory.initial">com.tibco.tibjms.naming.TibjmsInitialContextFactory</prop>
        </props>
        </property>
    </bean>



Error we are getting
====================


WARN  [27 Oct 2011 13:35:03:273] atomikos                      - ERROR IN RECOVERY
com.atomikos.datasource.ResourceException: Error in getting XA resource
    at com.atomikos.datasource.xa.jms.JmsTransactionalResource.refreshXAConnection(JmsTransactionalResource.java:122)
    at com.atomikos.datasource.xa.XATransactionalResource.getXAResource(XATransactionalResource.java:373)
    at com.atomikos.datasource.xa.XATransactionalResource.endRecovery(XATransactionalResource.java:655)
    at com.atomikos.icatch.imp.TransactionServiceImp.recover(TransactionServiceImp.java:635)
    at com.atomikos.datasource.xa.XATransactionalResource.setRecoveryService(XATransactionalResource.java:503)
    at com.atomikos.icatch.system.Configuration.installRecoveryService(Configuration.java:278)
    at com.atomikos.icatch.imp.TransactionServiceImp.recover(TransactionServiceImp.java:580)



WARN  [27 Oct 2011 13:35:08:116] atomikos                      - Failed to grow the connection pool
com.atomikos.datasource.pool.CreateConnectionException: error creating JMS connection
    at com.atomikos.jms.AtomikosJmsXAConnectionFactory.createPooledConnection(AtomikosJmsXAConnectionFactory.java:61)
    at com.atomikos.datasource.pool.ConnectionPool.growPool(ConnectionPool.java:190)
    at com.atomikos.datasource.pool.ConnectionPool.borrowConnection(ConnectionPool.java:143)
    at com.atomikos.jms.AtomikosConnectionFactoryBean.createConnection(AtomikosConnectionFactoryBean.java:585)
    at com.atomikos.jms.AtomikosConnectionFactoryBean.createConnection(AtomikosConnectionFactoryBean.java:604)
    at org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter.doCreateConnection(UserCredentialsConnectionFactoryAdapter.java:174)
    at org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter.createConnection(UserCredentialsConnectionFactoryAdapter.java:149)



    at app.dogs.publisher.MessageInput.run(MessageInput.java:49)
    at java.lang.Thread.run(Unknown Source)
Caused by: javax.jms.JMSSecurityException: Failed to connect to any server at: tcp://MACHINE:40822,tcp://MACHINE:40822 [Error: invalid name or password: url that returned this exception = TCP://MACHINE:40822 ]
    at com.tibco.tibjms.TibjmsConnection._create(TibjmsConnection.java:1389)
    at com.tibco.tibjms.TibjmsConnection.<init>(TibjmsConnection.java:4127)
    at com.tibco.tibjms.TibjmsXAConnection.<init>(TibjmsXAConnection.java:30)
    at com.tibco.tibjms.TibjmsXATopicConnection.<init>(TibjmsXATopicConnection.java:29)
    at com.tibco.tibjms.TibjmsxCFImpl._createImpl(TibjmsxCFImpl.java:145)

Thanks
Raghu
Raghavender Rao T Send private email
Thursday, October 27, 2011
 
 
In short, we were able to run the TIBCO JMS Send and a database update in one global transaction on a TIBCO EMS Server which doesnot need authentication.

Now we want to do the same by passing the username and password from the spring-atomikos beans. Please let us know how can we pass the username and password for the TIBCO EMS authentication.
Raghavender Rao T Send private email
Thursday, October 27, 2011
 
 
Hi,

Did you try passing user/pw as xaProperties on the AtomikosDataSourceBean?

HTH
Guy Pardon Send private email
Friday, October 28, 2011
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics