0

I am trying to configure Atomikos in my Spring application. I am using:

  • Atomikos 3.7.1 (TransactionsEssentials)
  • Spring 3.0.2
  • Tibco EMS 5.1

Can some one give me the configuration details for the connection factory using JNDI for JMS and also details regarding Tibco EMS configuration?

I had tried the following:

 <bean id="jmsTemplate2" class="org.springframework.jms.core.JmsTemplate" >
    <property name="connectionFactory" ref="amqConnectionFactory" />
    <property name="defaultDestination" ref="queue" />
    <property name="sessionTransacted" value="true"/>
    <property name="messageConverter" ref="messageConverter"></property>
</bean>


<bean id="amqConnectionFactory" class="com.atomikos.jms.AtomikosConnectionFactoryBean"    init-method="init">
    <property name="uniqueResourceName" value="XAEMS" />
    <property name="xaConnectionFactory" ref="connectionFactory" />
    <property name="poolSize" value="10" />
</bean>

<jee:jndi-lookup id="connectionFactory" jndi-name="emsConnectionFactory">
    <jee:environment>
        java.naming.factory.initial=com.tibco.tibjms.naming.TibjmsInitialContextFactory
        java.naming.provider.url=tibjmsnaming://localhost:7222
    </jee:environment>
</jee:jndi-lookup> 

<jee:jndi-lookup id="queue" jndi-name="emsQueue">
    <jee:environment>
        java.naming.factory.initial=com.tibco.tibjms.naming.TibjmsInitialContextFactory
        java.naming.provider.url=tibjmsnaming://localhost:7222
    </jee:environment>
</jee:jndi-lookup>

But get this error:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'amqConnectionFactory' defined in file [C:\springsource\vfabric-tc-server-developer-2.6.4.RELEASE\spring-insight-instance\wtpwebapps\iRebal-Backend-Poc-Web-Integration-Final-xa\WEB-INF\classes\META-INF\spring\batch\jobs\priority-queue.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'com.tibco.tibjms.naming.TibjmsFederatedQueueConnectionFactory' to required type 'javax.jms.XAConnectionFactory' for property 'xaConnectionFactory'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.tibco.tibjms.naming.TibjmsFederatedQueueConnectionFactory] to required type [javax.jms.XAConnectionFactory] for property 'xaConnectionFactory': no matching editors or conversion strategy found
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
... 39 more
Caused by: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'com.tibco.tibjms.naming.TibjmsFederatedQueueConnectionFactory' to required type 'javax.jms.XAConnectionFactory' for property 'xaConnectionFactory'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.tibco.tibjms.naming.TibjmsFederatedQueueConnectionFactory] to required type [javax.jms.XAConnectionFactory] for property 'xaConnectionFactory': no matching editors or conversion strategy found
at org.springframework.beans.BeanWrapperImpl
Perception
  • 79,279
  • 19
  • 185
  • 195
shashikanthb
  • 379
  • 2
  • 9
  • 21

2 Answers2

1

This answer is too late for the OP, but for the sake of posterity:

The class you want is com.tibco.tibjms.TibjmsXAConnectionFactory.

Larry McQueary
  • 416
  • 3
  • 9
0

It seems that in class com.atomikos.jms.AtomikosConnectionFactoryBean you have a field named xaConnectionFactory that its type (or its getter return type) is javax.jms.XAConnectionFactory. However, in Spring configuration file, you configured that field to be set with an instance of which type is com.tibco.tibjms.naming.TibjmsFederatedQueueConnectionFactory.

Apparently com.tibco.tibjms.naming.TibjmsFederatedQueueConnectionFactory is not convertible to javax.jms.XAConnectionFactory.

yair
  • 8,945
  • 4
  • 31
  • 50
  • Thats right. I want to know whether tibco has a connectionFactory class that implements javax.jms.XAConnectionFactory interface. I have been able to test it with ActiveMQ successfully. – shashikanthb Apr 24 '12 at 08:00