Thanks  bsnyder, The question on stackoverflow was my question. Thanks for
your answer. But even I update it to 2.5.6, it still doesn't work. Here is
part of my config file, I've been struggle with this for two days, I don't
know if their are other ways to get transactions to work :


<bean id="connectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
        <property name="brokerURL" value="vm://localhost" />
</bean>

        <!-- ActiveMQ Queue destination -->
<bean id="emailDestination"
class="org.apache.activemq.command.ActiveMQQueue">
        <constructor-arg index="0" value="emailQueue" />
</bean>

        <!-- Message converter bean -->
<bean id="emailFormatConverter"
class="com.suzsoft.framework.util.mail.EmailFormatConverter" />

        <!-- DefaultMessageListenerContainer -->
<bean
class="org.springframework.jms.listener.DefaultMessageListenerContainer">
        <property name="connectionFactory" ref="connectionFactory" />
        <property name="destination" ref="emailDestination" />
        <property name="messageListener" ref="emailServiceMDP" />
        <property name="transactionManager" ref="jmsTransactionManager" />
        <!--<property name="concurrentConsumers" value="1" />-->
        <!--
0:CACHE_NONE,1:CACHE_CONNECTION,2:CACHE_SESSION,3:CACHE_CONSUMER,4:CACHE_AUTO
-->
        <!--<property name="cacheLevel" value="0"/>-->
        <!--<property name="sessionTransacted" value="true" />-->
</bean>

<bean id="jmsTransactionManager"
class="org.springframework.jms.connection.JmsTransactionManager">
        <property name="connectionFactory" ref="connectionFactory" />
</bean>

<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
        <property name="connectionFactory" ref="connectionFactory" />
        <property name="defaultDestination" ref="emailDestination" />
        <property name="messageConverter" ref="emailFormatConverter" />
</bean>

<bean id="emailServiceMDP"
class="org.springframework.jms.listener.adapter.MessageListenerAdapter"
scope="prototype">
        <property name="delegate" ref="emailService" />
        <property name="defaultListenerMethod" value="processEmailSending" />
        <property name="messageConverter" ref="emailFormatConverter" />
</bean>









bsnyder wrote:
> 
> On Tue, May 25, 2010 at 9:48 PM, zzcat <evo...@gmail.com> wrote:
>>
>> Hi Gary , even if I updated my spring to 2.5.6 , I still got the same
>> error.
>> Here is my stack trace. It says can't find
>> "org.springframework.transaction.support.TransactionSynchronizationUtils.sameResourceFactory"
>>
>> actually this method does exist in 2.5.5. I guess there're some other
>> issues.
>>
>> 10:23:49 ERROR Context initialization failed
>> org.springframework.beans.factory.BeanCreationException: Error creating
>> bean
>> with name
>> 'org.springframework.jms.listener.DefaultMessageListenerContainer#0'
>> defined
>> in ServletContext resource
>> [/WEB-INF/config/spring/component/applicationContext-jms-activemq5.xml]:
>> Invocation of init method failed; nested exception is
>> java.lang.NoSuchMethodError:
>> org.springframework.transaction.support.TransactionSynchronizationUtils.sameResourceFactory(Lorg/springframework/transaction/support/ResourceTransactionManager;Ljava/lang/Object;)Z
> 
> I answered this question on StackOverflow:
> 
> http://stackoverflow.com/questions/2905279/activemq-integration-with-spring-2-5/
> 
> I think it's because you have an older version of the spring-tx jar
> first in your classpath.
> 
> Bruce
> -- 
> perl -e 'print
> unpack("u30","D0G)u8...@4vyy9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> );'
> 
> ActiveMQ in Action: http://bit.ly/2je6cQ
> Blog: http://bruceblog.org/
> Twitter: http://twitter.com/brucesnyder
> 
> 

-- 
View this message in context: 
http://old.nabble.com/ActiveMq-integration-with-Spring-2.5-tp28668647p28682881.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to