struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mauricio Aniche <>
Subject @Transactional Spring Annotation in a Struts2 Action does not work
Date Fri, 01 May 2009 00:31:11 GMT

I am using Struts2+Spring+JPA/Hibernate. When I use the @Transactional to
mark an execute() method in a Struts2 Action, the action stops working
properly (i.e. the attributes in the action are not automatically setted).
It does not work with Spring AOP transactions as well.

In my struts.config I setted the following constant:
<constant name="struts.objectFactory" value="spring" />

In my applicationContext.xml I set the pointcut to the actions. I have the
    <tx:advice id="txAdvice" transaction-manager="transactionManager">
            <tx:method name="execute" propagation="REQUIRED"
rollback-for="package.RepositorioException" />

        <aop:pointcut id="ActionsComTransacao"
            expression="execution(* package.actions.*.*(..))" />
        <aop:advisor advice-ref="txAdvice"
pointcut-ref="ActionsComTransacao" />

And in my web.config I have open-session-in-view, struts2 filters and the
spring listener:






        <description>Spring Listener</description>


The funny thing is that if I use the transaction aspect in any other package
(i.e. my repositories) everything works fine. It just crashes when I use it
in the struts action.

Any idea?

Thanks in advance,

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message