Hi,

right, that's because JTA doesn't define a method which let you get the
cause :(

However OpenJPA logs the error just before the exception so you should see
them

please see https://issues.apache.org/jira/browse/TOMEE-172

*Romain Manni-Bucau*
*Twitter: @rmannibucau*
*Blog: http://rmannibucau.wordpress.com*




2012/9/12 Martin Kjær Jørgensen <[email protected]>

> Hi
>
> I'm using embedded OpenEJB 4.0.0 for testing in my project and I'm
> testing it's JTA features. It seems that if I use a persistenceunit with
> transaction-type="RESOURCE_LOCAL" I get full stacktraces in the logs if
> something exceptions gets thrown.
>
> But if i use transaction-type="JTA", let the container control the
> transactions (@TransactionAttribute), and log (log4j) the exceptions
> occuring, I only get something like:
>
>
> javax.ejb.EJBTransactionRolledbackException: Transaction was rolled
> back, presumably because setRollbackOnly was called during a
> synchronization
>         at
>
> org.apache.openejb.core.ivm.BaseEjbProxyHandler.convertException(BaseEjbProxyHandler.java:350)
> .......
>
> Caused by: javax.transaction.RollbackException: Unable to commit:
> transaction marked for rollback
>         at
>
> org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:272)
> .......
>
> Caused by:
> org.apache.geronimo.transaction.manager.SetRollbackOnlyException:
> setRollbackOnly() called.  See stacktrace for origin
>         at
>
> org.apache.geronimo.transaction.manager.TransactionImpl.setRollbackOnly(TransactionImpl.java:126)
> .......
>
> Nothing specific of what or where the exception occured.
>
>
> Is there some logging or config that needs to be done or can I "inject"
> my own exception handling/logging in JTA to make it more usable?
>
>

Reply via email to