You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Rahul Dev <ra...@yahoo.com> on 2007/03/11 17:25:18 UTC

jms and jdbc operations in one transaction

Hi,

I have been trying to get the latest version of Jencks / Active MQ / Transactions and Hibernate to work together using Spring.

I have referred to this article written by james sometime last year : http://activemq.apache.org/jms-and-jdbc-operations-in-one-transaction.html 

The article seems to use an old version of Jencks and ActiveMQ and certian dependent libraries were not found. I managed to download these "older" libraries and ensured that all dependent libraires were there but then the application refuses to start and I get the following exception:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jmsConnectionFactory' defined in class path resource [jencks-activemq.xml]: Cannot resolve reference to bean 'connectionManager' while setting bean property 'connectionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'connectionManager': FactoryBean threw exception on object creation; nested exception is java.lang.NoSuchMethodError: org.apache.geronimo.connector.outbound.GenericConnectionManager.<init>(Lorg/apache/geronimo/connector/outbound/connectionmanagerconfig/TransactionSupport;Lorg/apache/geronimo/connector/outbound/connectionmanagerconfig/PoolingSupport;ZLorg/apache/geronimo/connector/outbound/connectiontracking/ConnectionTracker;Lorg/apache/geronimo/transaction/context/TransactionContextManager;Ljava/lang/String;Ljava/lang/ClassLoader;)V
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'connectionManager': FactoryBean threw exception on object creation; nested exception is java.lang.NoSuchMethodError: org.apache.geronimo.connector.outbound.GenericConnectionManager.<init>(Lorg/apache/geronimo/connector/outbound/connectionmanagerconfig/TransactionSupport;Lorg/apache/geronimo/connector/outbound/connectionmanagerconfig/PoolingSupport;ZLorg/apache/geronimo/connector/outbound/connectiontracking/ConnectionTracker;Lorg/apache/geronimo/transaction/context/TransactionContextManager;Ljava/lang/String;Ljava/lang/ClassLoader;)V
Caused by: java.lang.NoSuchMethodError: org.apache.geronimo.connector.outbound.GenericConnectionManager.<init>(Lorg/apache/geronimo/connector/outbound/connectionmanagerconfig/TransactionSupport;Lorg/apache/geronimo/connector/outbound/connectionmanagerconfig/PoolingSupport;ZLorg/apache/geronimo/connector/outbound/connectiontracking/ConnectionTracker;Lorg/apache/geronimo/transaction/context/TransactionContextManager;Ljava/lang/String;Ljava/lang/ClassLoader;)V
    at org.jencks.factory.ConnectionManagerFactoryBean.getObject(ConnectionManagerFactoryBean.java:64)


I would prefer to get the system working with the latest set of Active MQ (apache-activemq-4.1.0-incubator) / Jencks 2.0 / Hibernate 3.0 working.

Can someone kindly guide me on how to solve this problem and possibly update the document on the web with the right versions of dependent libraries? 

An updated version on the web will help all other users who wish to use the latest versions as well.

Thanks in advance,
Rahul

 
---------------------------------
We won't tell. Get more on shows you hate to love
(and love to hate): Yahoo! TV's Guilty Pleasures list.

Re: [Spam: 5.0] jms and jdbc operations in one transaction

Posted by drvillo <f....@gmail.com>.
Hi

Jencks 2 has changed the way to wire things up:

I use 

    <bean id="transactionManager"
class="org.jencks.factory.TransactionManagerFactoryBean"/>


    <!-- Jencks Connection Manager -->
    <bean id="connectionManager"
class="org.jencks.factory.ConnectionManagerFactoryBean">
        <property name="transactionManager" ref="transactionManager"/>
        <property name="transaction" value="local"/>
        <property name="pooling" value="true"/>
        <property name="allConnectionsEqual" value="true"/>
        <property name="poolMaxSize" value="${connection.pool.size}"/>
        <property name="poolMinSize" value="1"/>
        <property name="connectionMaxWaitMilliseconds" value="60"/>
        <property name="connectionMaxIdleMinutes" value="60"/>
    </bean>

    <bean id="jmsResourceAdapter"
class="org.apache.activemq.ra.ActiveMQResourceAdapter" depends-on="broker">
        <property name="serverUrl" value="${server.url}"/>
    </bean>

    <bean id="jmsManagedConnectionFactory"
class="org.apache.activemq.ra.ActiveMQManagedConnectionFactory"
          depends-on="jmsResourceAdapter">
        <property name="resourceAdapter" ref="jmsResourceAdapter"/>
    </bean>
    <bean id="jmsConnectionFactory"
class="org.jencks.factory.ConnectionFactoryFactoryBean">
        <property name="managedConnectionFactory"
ref="jmsManagedConnectionFactory"/>
        <property name="connectionManager" ref="connectionManager"/>
    </bean>


About the jdbc part you can use the transactionManager specified above. 
At least at the time I tested it, both tranql and StandardXADataSource had
some
problems supporting full XA semantics (especially rollbacks).
If it has improved let me know...

Hope this helps,
Francesco


Rahul Dev wrote:
> 
> Hi,
> 
> I have been trying to get the latest version of Jencks / Active MQ /
> Transactions and Hibernate to work together using Spring.
> 
> I have referred to this article written by james sometime last year :
> http://activemq.apache.org/jms-and-jdbc-operations-in-one-transaction.html 
> 
> The article seems to use an old version of Jencks and ActiveMQ and certian
> dependent libraries were not found. I managed to download these "older"
> libraries and ensured that all dependent libraires were there but then the
> application refuses to start and I get the following exception:
> 
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean with name 'jmsConnectionFactory' defined in class path resource
> [jencks-activemq.xml]: Cannot resolve reference to bean
> 'connectionManager' while setting bean property 'connectionManager';
> nested exception is
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean with name 'connectionManager': FactoryBean threw exception on object
> creation; nested exception is java.lang.NoSuchMethodError:
> org.apache.geronimo.connector.outbound.GenericConnectionManager.<init>(Lorg/apache/geronimo/connector/outbound/connectionmanagerconfig/TransactionSupport;Lorg/apache/geronimo/connector/outbound/connectionmanagerconfig/PoolingSupport;ZLorg/apache/geronimo/connector/outbound/connectiontracking/ConnectionTracker;Lorg/apache/geronimo/transaction/context/TransactionContextManager;Ljava/lang/String;Ljava/lang/ClassLoader;)V
> Caused by: org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'connectionManager': FactoryBean threw exception
> on object creation; nested exception is java.lang.NoSuchMethodError:
> org.apache.geronimo.connector.outbound.GenericConnectionManager.<init>(Lorg/apache/geronimo/connector/outbound/connectionmanagerconfig/TransactionSupport;Lorg/apache/geronimo/connector/outbound/connectionmanagerconfig/PoolingSupport;ZLorg/apache/geronimo/connector/outbound/connectiontracking/ConnectionTracker;Lorg/apache/geronimo/transaction/context/TransactionContextManager;Ljava/lang/String;Ljava/lang/ClassLoader;)V
> Caused by: java.lang.NoSuchMethodError:
> org.apache.geronimo.connector.outbound.GenericConnectionManager.<init>(Lorg/apache/geronimo/connector/outbound/connectionmanagerconfig/TransactionSupport;Lorg/apache/geronimo/connector/outbound/connectionmanagerconfig/PoolingSupport;ZLorg/apache/geronimo/connector/outbound/connectiontracking/ConnectionTracker;Lorg/apache/geronimo/transaction/context/TransactionContextManager;Ljava/lang/String;Ljava/lang/ClassLoader;)V
>     at
> org.jencks.factory.ConnectionManagerFactoryBean.getObject(ConnectionManagerFactoryBean.java:64)
> 
> 
> I would prefer to get the system working with the latest set of Active MQ
> (apache-activemq-4.1.0-incubator) / Jencks 2.0 / Hibernate 3.0 working.
> 
> Can someone kindly guide me on how to solve this problem and possibly
> update the document on the web with the right versions of dependent
> libraries? 
> 
> An updated version on the web will help all other users who wish to use
> the latest versions as well.
> 
> Thanks in advance,
> Rahul
> 
>  
> ---------------------------------
> We won't tell. Get more on shows you hate to love
> (and love to hate): Yahoo! TV's Guilty Pleasures list.
> 

-- 
View this message in context: http://www.nabble.com/jms-and-jdbc-operations-in-one-transaction-tf3384983s2354.html#a9437911
Sent from the ActiveMQ - User mailing list archive at Nabble.com.