camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: JPA component and JTA
Date Fri, 05 Oct 2012 13:45:25 GMT
On Fri, Oct 5, 2012 at 3:34 PM, Lucas Amador <> wrote:
> Hi,
> I'm struggling trying to configure a camel route which uses JPA and a JTA transaction
manager (bitronix) together with Spring. As I can read in the JPA component documentation,
> the transactionManager can be specified in the route URI just configuring the transactionManager
option in the route URI. But I can't make it work.
> the transaction manager is working well with the JMS component, but I don't know how
to configure the jpa route URI's. I got the next stack trace error, which makes totally sense.
> org.apache.camel.FailedToCreateRouteException: Failed to create route productJmsPersistenceTransactedWithException
at: >>> Transacted[] <<< in route: Route[[From[jms:queue:xxx.yyy]] ->
[OnException[[class ja... because of Failed to resolve endpoint: jpa://com.example.Person?transactionManager=jtaTransactionManager
due to: Could not find a suitable setter for property: transactionManager as there isn't a
setter method with same type: java.lang.String nor type conversion possible: No type converter
available to convert from type: java.lang.String to the required type: org.springframework.transaction.PlatformTransactionManager
with value jtaTransactionManager
> spring configuration excerpt
> <bean id="btmTransactionManager" class="bitronix..." />
> <bean id="jtaTransactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
>   <property name="transactionManager" ref="btmTransactionManager" />
>   <property name="userTransaction" ref="btmTransactionManager" />
> </bean>
> <camel:to uri="jpa:com.example.Person?transactionManager=jtaTransactionManager" />

You need a # to refer to a bean by its id
<camel:to uri="jpa:com.example.Person?transactionManager=#jtaTransactionManager"

> Any idea?
> Regards,
> --
> Lucas Amador

Claus Ibsen
Red Hat, Inc.
FuseSource is now part of Red Hat
Twitter: davsclaus
Author of Camel in Action:

View raw message