[jbossseam-issues] [JBoss JIRA] Reopened: (JBSEAM-456) Interceptor tries to access UserTransaction interface, but this is not allowed for CMT
Guy Veraghtert (JIRA)
jira-events at jboss.com
Tue Nov 14 05:12:41 EST 2006
[ http://jira.jboss.com/jira/browse/JBSEAM-456?page=all ]
Guy Veraghtert reopened JBSEAM-456:
-----------------------------------
You are completely right, we will file a bug report to the GlassFish-team.
Thx for the workaround, however, the workaround contains a bug on GlassFish, well, in fact, the EJB-class does:
In org.jboss.seam.util.EJB the EJBContext is looked up using name: java:comp.ejb3/EJBContext. This works fine on JBoss, but not on GlassFish (resulting in a NameNotFoundException). The EJB-spec states (section 16.15, p.451) :
"The container must make a component's EJBContext interface available either through injection
using the Resource annotation or in JNDI under the name java:comp/EJBContext. "
Patched locally this way in class org.jboss.seam.util.EJB:
public static final String STANDARD_EJBCONTEXT_NAME = "java:comp/EJBContext";
public static EJBContext getEJBContext() throws NamingException
{
try
{
return (EJBContext) Naming.getInitialContext().lookup(STANDARD_EJBCONTEXT_NAME);
}
catch (NameNotFoundException nnfe)
{
return (EJBContext) Naming.getInitialContext().lookup(EJBCONTEXT_NAME);
}
}
> Interceptor tries to access UserTransaction interface, but this is not allowed for CMT
> --------------------------------------------------------------------------------------
>
> Key: JBSEAM-456
> URL: http://jira.jboss.com/jira/browse/JBSEAM-456
> Project: JBoss Seam
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.1.0.BETA1
> Environment: Glassfish
> Reporter: Guy Veraghtert
> Assigned To: Gavin King
> Priority: Critical
> Fix For: 1.1.0.BETA2
>
>
> In method getEntityManager() in class ManagedPersistenceContext a call is made to the UserTransaction interface: getStatus(). According to the EJB 3.0 specification (p.81) this is not allowed for CMT. Seam requires the usage of CMT.
> (Occurs when adding @In to an entityManager-field, according to seam doc 11.4).
> Patched locally in class ManagedPersistenceContext :
> @Unwrap
> public EntityManager getEntityManager() throws NamingException, SystemException
> {
> if ( !Lifecycle.isDestroying() /*&& Transactions.isTransactionActive()*/ )
> {
> try
> {
> entityManager.joinTransaction();
> } catch (TransactionRequiredException e) {
>
> }
> }
> return entityManager;
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the seam-issues
mailing list