[jboss-jira] [JBoss JIRA] (WFLY-4386) EJB annotations ignored if classes are packaged as JBOSS modules
Tihomir Meščić (JIRA)
issues at jboss.org
Wed Feb 25 09:45:50 EST 2015
[ https://issues.jboss.org/browse/WFLY-4386?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tihomir Meščić updated WFLY-4386:
---------------------------------
Description:
I have an EJB that writes something to the DB and I have a custom checked exception that is marked as @javax.ejb.ApplicationException(rollback=true), which means that when the exception is thrown, transaction should be rollbacked.
{code:title=Test.java.java|borderStyle=solid}
@ApplicationException(rollback=true)
public class MyException extends Exception {
{code}
This exception is packaged in a separate JAR.
When this JAR is included in the lib/ folder of the EAR with my EJB, everything works as expected (when the EJB throws MyException, the transaction is rollbacked).
However, when this JAR is deployed as a JBOSS module (so, in jboss_folder/modules/... folder), and the EAR declares a dependency on this module (MANIFEST.MF -> Dependencies: ....) , then the transaction is NOT rollbacked. So the EJB container ignores the annotation.
One workaround (that I don't really like) is to specify that this is an application exception in the jboss-ejb3.xml (then, the transaction will be rollbacked).
was:
I have an EJB that writes something to the DB and I have a custom checked exception that is marked as @javax.ejb.ApplicationException(rollback=true), which means that when the exception is thrown, transaction should be rollbacked.
{code:title=Test.java.java|borderStyle=solid}
@ApplicationException(rollback=true)
public class MyException extends Exception {
{code}
This exception is packaged in a separate JAR.
When this JAR is included in the lib/ folder of the EAR with my EJB, everything works as expected (when the EJB throws MyException, the transaction is rollbacked).
However, when this JAR is deployed as a JBOSS module (so, in ${jboss}/modules/... folder), and the EAR declares a dependency on this module (MANIFEST.MF -> Dependencies: ....) , then the transaction is NOT rollbacked. So the EJB container ignores the annotation.
One workaround (that I don't really like) is to specify that this is an application exception in the jboss-ejb3.xml (then, the transaction will be rollbacked).
> EJB annotations ignored if classes are packaged as JBOSS modules
> ----------------------------------------------------------------
>
> Key: WFLY-4386
> URL: https://issues.jboss.org/browse/WFLY-4386
> Project: WildFly
> Issue Type: Bug
> Components: Class Loading, EJB
> Affects Versions: JBoss AS7 7.1.1.Final
> Reporter: Tihomir Meščić
> Assignee: David Lloyd
>
> I have an EJB that writes something to the DB and I have a custom checked exception that is marked as @javax.ejb.ApplicationException(rollback=true), which means that when the exception is thrown, transaction should be rollbacked.
> {code:title=Test.java.java|borderStyle=solid}
> @ApplicationException(rollback=true)
> public class MyException extends Exception {
> {code}
>
> This exception is packaged in a separate JAR.
>
> When this JAR is included in the lib/ folder of the EAR with my EJB, everything works as expected (when the EJB throws MyException, the transaction is rollbacked).
> However, when this JAR is deployed as a JBOSS module (so, in jboss_folder/modules/... folder), and the EAR declares a dependency on this module (MANIFEST.MF -> Dependencies: ....) , then the transaction is NOT rollbacked. So the EJB container ignores the annotation.
>
> One workaround (that I don't really like) is to specify that this is an application exception in the jboss-ejb3.xml (then, the transaction will be rollbacked).
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
More information about the jboss-jira
mailing list