Announcement Announcement Module
No announcement yet.
Using "aspectj" mode for annotation-driven transaction, breaks atomikos Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using "aspectj" mode for annotation-driven transaction, breaks atomikos


    I've been using a Spring + Atomikos + Hibernate(MySQL) + ActiveMQ configuration which worked fine, until I ran into a situation where I had to add a @Transactional method to a class that was @Configurable.

    At that point, I ran into the incompatibility of mixing aspect-weaving with spring-proxying, which led to this exception:

    java.lang.IllegalStateException: Post-processor tried to replace bean instance of type [] with (proxy) object of type [org.springframework.beans.factory.aspectj.$Proxy68] - not supported for aspect-configured classes!
    In this forum, it was suggested that I switch to using "aspectj" mode for the transaction management, which I did by using:

        <tx:annotation-driven transaction-manager="transactionManager" 
        	mode="aspectj" proxy-target-class="false" />
    However, when I try to send a JMS message I now get a complaint from Atomikos claiming:

    com.atomikos.jms.AtomikosTransactionRequiredJMSException: The JMS session you are using requires a JTA transaction context for the calling thread and none was found.
    Please correct your code to do one of the following: 
    1. start a JTA transaction if you want your JMS operations to be subject to JTA commit/rollback, or
    2. increase the maxPoolSize of the AtomikosConnectionFactoryBean to avoid transaction timeout while waiting for a connection, or
    3. create a non-transacted session and do session acknowledgment yourself, or
    4. set localTransactionMode to true so connection-level commit/rollback are enabled.
    	at com.atomikos.jms.AtomikosTransactionRequiredJMSException.throwAtomikosTransactionRequiredJMSException(
    	at com.atomikos.jms.ConsumerProducerSupport.enlist(
    	at com.atomikos.jms.AtomikosJmsMessageProducerProxy.send(
    	at com.atomikos.jms.AtomikosJmsMessageProducerProxy.send(
    	at org.springframework.jms.core.JmsTemplate.doSend(
    	at org.springframework.jms.core.JmsTemplate.doSend(
    	at org.springframework.jms.core.JmsTemplate$3.doInJms(
    	at org.springframework.jms.core.JmsTemplate.execute(
    	... 49 more
    Has anyone ever used aspectj-mode successfully with Atomikos?

  • #2
    Busted like a rookie! I had not configured the maven-aspectj-plugin to run for in the pom.xml of that specific module...

    Oh, the shame!