[
https://issues.jboss.org/browse/AS7-5432?page=com.atlassian.jira.plugin.s...
]
Barnabas Bodnar commented on AS7-5432:
--------------------------------------
Related to
https://github.com/jbossas/jboss-as/pull/3003#issuecomment-8353921:
In the case of remote EJB-invocations it is understandable to avoid chaining arbitrary
exceptions to the RemoteException, in order to avoid propagating server-internal classes
to the client-side.
The reported problem regards, however, only local EJB-calls and especially
EJBTransactionRolledbackExceptions, because application-runtime-exceptions are carried -
in the case of existing transactions - by them.
Would you agree to apply the fix only to
org.jboss.as.ejb3.component.interceptors.EjbExceptionTransformingInterceptorFactories.LOCAL_INSTANCE,
eventually solely to EJBTransactionRolledbackException? (the latter would even not require
using initCause(...), because the target-exception-class
TransactionRolledbackLocalException has a constructor expecting a cause-exception:
{code}
} catch (EJBTransactionRolledbackException e) {
throw new TransactionRolledbackLocalException(e.getMessage(),
e.getCausedByException());
}
{code}
)
The current behavior of JBoss7 deviates from that of older JBoss-versions (4.x, 5.x) and
even from that of other application-servers (Oracle Weblogic, IBM Websphere) and may
represent a show-stopper for existing applications, which rely on obtaining the causing
runtime-exception after a failed EJB-call; from this point of view has this fix a high
significance.
TransactionRolledbackLocalException doesn't reference the
originating runtime-exception
---------------------------------------------------------------------------------------
Key: AS7-5432
URL:
https://issues.jboss.org/browse/AS7-5432
Project: Application Server 7
Issue Type: Bug
Components: EJB
Affects Versions: 7.1.1.Final, 7.1.2.Final (EAP)
Reporter: Barnabas Bodnar
Assignee: jaikiran pai
Priority: Minor
Fix For: 7.2.0.Alpha1, 7.1.4.Final (EAP)
If a runtime-exception thrown by an EJB v2.x application leads to
javax.ejb.TransactionRolledbackLocalException (s.
org.jboss.as.ejb3.tx.CMTTxInterceptor.handleInCallerTx(...)), the
TransactionRolledbackLocalException doesn't reference the originating exception
(either as getCause() or as getCausedByException()).
The originating exception gets in
org.jboss.as.ejb3.component.interceptors.EjbExceptionTransformingInterceptorFactories.LOCAL_INSTANCE
lost: the javax.ejb.EJBTransactionRolledbackException catched here does still contain it,
it will, however, not be propagated to the javax.ejb.TransactionRolledbackLocalException
created here.
This behavior also deviates from that in the case of a locally started transaction: the
wrapping javax.ejb.EJBException (s.
org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(...)) is thrown unchanged to
the caller (s.
org.jboss.as.ejb3.component.interceptors.EjbExceptionTransformingInterceptorFactories.LOCAL_INSTANCE)
and it references the originating exception both as getCause() and as
getCausedByException().
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira