Atomikos Forum

Cannot create resource instance

I am pretty new to all of Spring, Hibernate and especially Atomikos. I have spring and hibernate working together with two datasources/sessionFactories and am now trying to get Atomikos working. I am using the following spring-config:

<bean id="datasource" class="com.atomikos.jdbc.nonxa.AtomikosNonXADataSourceBean">
        <property name="uniqueResourceName"><value>NONXADBMS</value></property>
        <property name="user"><value>prosoc</value></property>
        <property name="password"><value>prosoc-</value></property>
        <property name="url"><value>jdbc:mysql://localhost:3306/prosoc</value></property>
        <property name="driverClassName"><value>com.mysql.jdbc.Driver</value></property>
        <property name="poolSize"><value>1</value></property>
        <property name="borrowConnectionTimeout"><value>60</value></property>
    </bean>

    <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
      <property name="mappingResources">
          <list>
              <value>uk/co/prodia/prosoc/user/User.hbm.xml</value>
          </list>
      </property>
      <property name="dataSource"><ref bean="datasource"/></property>
      <property name="hibernateProperties">
          <props>
              <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
              <prop key="hibernate.connection.isolation">3</prop>
              <prop key="hibernate.current_session_context_class">jta</prop>
              <prop key="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</prop>
              <prop key="hibernate.transaction.manager_lookup_class">com.atomikos.icatch.jta.hibernate3.TransactionManagerLookup</prop>
          </props>
      </property>
    </bean>
   
    <bean id="atomikosTransactionManager" class="com.atomikos.icatch.jta.UserTransactionManager" init-method="init" destroy-method="close">
        <property name="forceShutdown"><value>true</value></property>
    </bean>

    <bean id="atomikosUserTransaction" class="com.atomikos.icatch.jta.UserTransactionImp">
        <property name="transactionTimeout"><value>300</value></property>
    </bean>

    <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
        <property name="transactionManager"><ref bean="atomikosTransactionManager"/></property>
        <property name="userTransaction"><ref bean="atomikosUserTransaction"/></property>
    </bean>

    <bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
        <property name="sessionFactory">
            <ref bean="sessionFactory" />
        </property>
    </bean>

    <bean id="userTarget" class="uk.co.prodia.prosoc.persistence.hibernate.DAOUserImpl">
        <property name="sessionFactory" ref="sessionFactory"/>
    </bean>

    <bean id="user" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
        <property name="transactionManager"><ref bean="transactionManager"/></property>
        <property name="target"><ref bean="userTarget"/></property>
        <property name="transactionAttributes">
            <props>
                <prop key="*">PROPAGATION_REQUIRED, -Exception</prop>
            </props>
        </property>
    </bean>
Gavin DOnald Send private email
Friday, August 01, 2008
 
 
SORRY - I AM HAVING TROUBLE POSTING TO THIS FORUM:

but I am receiving the following stack trace:

javax.naming.NamingException: Cannot create resource instance
    

I am using Hibernate-3.26-GA, Spring-2.54 and Atomikos-3.3.1.
Gavin DOnald Send private email
Friday, August 01, 2008
 
 
OK, I solved this problem by rolling Hibernate back to version 3.1.3, previously I was using version 3.2.
Gavin DOnald Send private email
Friday, August 01, 2008
 
 

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

Other recent topics Other recent topics