users@glassfish.java.net

Re: UserTransaction lookup failed.

From: Marina Vatkina <Marina.Vatkina_at_Sun.COM>
Date: Thu, 20 Aug 2009 13:09:29 -0700

It's against the EJB spec to be able to use UserTransaction inside a bean with
container managed transaction (CMT). Check your Hibernate setup - there should
be the way to do it without Hibernate using UserTransaction when it's not allowed.

Regards,
-marina

P.S. Lookup of "UserTransaction" is a GF-specific shortcut that should behave
the same way as the standard "java:comp/UserTransaction".


glassfish_at_javadesktop.org wrote:
> Hi martin,
>
> thanks for replying.
>
> My bean is annotated with
>
> @Stateless
> @TransactionAttribute(TransactionAttributeType.MANDATORY)
>
> but lookup with java:comp/UserTransaction is failing with the error:
>
> Caused by: javax.naming.NameNotFoundException: Lookup of java:comp/UserTransaction not allowed for Container managed Transaction beans
> at com.sun.ejb.containers.BaseContainer.checkUserTransactionLookup(BaseContainer.java:691)
> at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:190)
> at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:407)
> at javax.naming.InitialContext.lookup(InitialContext.java:392)
>
> Chris
> [Message sent by forum member 'milesy' (milesy)]
>
> http://forums.java.net/jive/thread.jspa?messageID=361398
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>