Atomikos Forum

AtomikosDataSourceBean - XA DataSource Creation Error

Hi,

I am trying to create jndi XADatasource in Tomcat context.xml and set in the spring config file. Getting below error message. Did anyone had the same problem?. If anyone know the fix for this issue could you please share?

org.springframework.jndi.TypeMismatchNamingException: Object of type [class com.atomikos.jdbc.AtomikosDataSourceBean] available at JNDI location [java:comp/env/jdbc/MyDb] is not assignable to [javax.sql.XADataSource]

Tomcat – Context.xml file.

          <Resource
            name="jdbc/MyDb"
            auth="Container"
            type="com.atomikos.jdbc.AtomikosDataSourceBean"
            factory="com.atomikos.tomcat.EnhancedTomcatAtomikosBeanFactory"
            uniqueResourceName="MyDb_Resource"
            maxPoolSize="8"
            xaDataSourceClassName="oracle.jdbc.xa.client.OracleXADataSource"
                    xaProperties.databaseName="***"
              xaProperties.serverName="****"
              xaProperties.portNumber="****"
              xaProperties.user="******"
              xaProperties.password="*****"
            />
                           

spring-config.xml file.

      <bean id="AomikosDataSourceBean1" class="com.atomikos.jdbc.AtomikosDataSourceBean" init-method="init" destroy-method="close" lazy-init="false">
      <property name="xaDataSource" ref="JTAXADataSource" />
      <property name="testQuery" value="select 1 from dual" />
      </bean>

      <bean id="JTAXADataSource" class="org.springframework.jndi.JndiObjectFactoryBean"
              scope="singleton">
              <property name="jndiName">
                    <value>java:comp/env/jdbc/MyDb</value>
              </property>
              <property name="expectedType"><value>javax.sql.XADataSource</value></property>
              <property name="resourceRef" value="true" />
      </bean>
Baskar Subramaniam Send private email
Friday, November 21, 2014
 
 

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

Other recent topics Other recent topics