camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shultz, Dmitry" <>
Subject RE: Camel JPA + JTA Transaction (TomEE)
Date Fri, 29 Jul 2016 21:45:42 GMT

TransactionManager  is never injected in my case (and yes, - I removed parameters from producer).

I'm having some strange problems with UserTransaction as well. It works when I'm deploying
the app on the already running TpomEE, but fails when TomEE is restarted with the app deployed.

Here is the exception (it is injected in the AppProducers class):

14:33| INFO | 191 | JMX is enabled
14:33| INFO | 56 | Loaded 185 type converters
14:33| INFO | 203 | Runtime endpoint registry is in extended
mode gathering usage statistics of all incoming and outgoing endpoints (cache limit: 1000)
14:33| INFO | 134 | Using EntityManagerFactory configured: org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory@56744adf
WARNING - Injection data not found in JNDI context: jndiName='comp/env/',
target=com. company.mix.wosess.camel.AppProducers/userTransaction
14:33| INFO | 3066 | Apache Camel 2.17.2 (CamelContext: event-storage-service)
is shutting down
14:33| INFO | 3151 | Apache Camel 2.17.2 (CamelContext: event-storage-service)
uptime 0.245 seconds
14:33| INFO | 3152 | Apache Camel 2.17.2 (CamelContext: event-storage-service)
is shutdown in 0.005 seconds
SEVERE - No JTA UserTransaction available - specify either 'userTransaction' or 'userTransactionName'
or 'transactionManager' or 'transactionManagerName'
java.lang.IllegalStateException: No JTA UserTransaction available - specify either 'userTransaction'
or 'userTransactionName' or 'transactionManager' or 'transactionManagerName'
        at org.springframework.transaction.jta.JtaTransactionManager.checkUserTransactionAndTransactionManager(
        at org.springframework.transaction.jta.JtaTransactionManager.afterPropertiesSet(
        at com.kaltire.mix.wosess.camel.AppProducers.createTransactionManager(
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(
        at java.lang.reflect.Method.invoke(
        at org.apache.webbeans.inject.InjectableMethod.doInjection(
        at org.apache.webbeans.portable.ProducerMethodProducer.produce(
        at org.apache.webbeans.portable.AbstractProducer.produce(
        at org.apache.webbeans.component.AbstractOwbBean.create(
        at org.apache.webbeans.component.ProducerMethodBean.create(
        at org.apache.webbeans.context.DependentContext.getInstance(
        at org.apache.webbeans.context.AbstractContext.get(
        at org.apache.webbeans.container.BeanManagerImpl.getReference(
        at org.apache.webbeans.container.InjectableBeanManager.getReference(
        at org.apache.camel.cdi.BeanManagerHelper.getReference(
        at org.apache.camel.cdi.CdiCamelRegistry.findByTypeWithName(
        at org.apache.camel.impl.PropertyPlaceholderDelegateRegistry.findByTypeWithName(
        at org.apache.camel.component.jpa.JpaComponent.doStart(

How to make it to support TomEE restart?


-----Original Message-----
From: Romain Manni-Bucau [] 
Sent: July-29-16 1:35 PM
Subject: Re: Camel JPA + JTA Transaction (TomEE)

Normally no,

private TransactionManager transactionManager;

or with a specified name if you prefer

@Resource(name = "java:comp/TransactionManager") // or java:comp/env/comp/TransactionManager
for some older tomee versions private TransactionManager transactionManager;

work to get injected by TomEE the transaction manager.

Did you remove the parameters from your producer?

Just a new JtaTransactionManager() without any configuration should also work relying on defaults
of spring.

The unsatisfied exception you get is cause spring is scanned as a EE library and does a @Inject
TransactionManager mgr;. Just add in


and it should work

Romain Manni-Bucau
@rmannibucau <> |  Blog <>
| Old Wordpress Blog <> | Github <>
| LinkedIn <> | Tomitriber <>
| JavaEE Factory <>

2016-07-29 20:17 GMT+02:00 dimas <>:

> Is there anything else i need to do besides just reference it as @Resource?
> It's still 'null'
> --
> View this message in context:
> 85642p5785653.html Sent from the Camel - Users mailing list archive at 
View raw message