You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Hassan Sajjad <ha...@premierhousewares.co.uk> on 2004/04/06 11:47:24 UTC

Problem with UserTransaction reference within Servlet code.

Hi

Can anyone help!

Problem with UserTransaction reference within Servlet code.

When you reference UserTransaction object in your Servlet Code, as from =
J2EE Specification: The J2EE Product Provider is responsible for =
providing an appropriate object as required ....


Context initCtx =3D new InitialContext();
// Look up the UserTransaction object.
UserTransaction tx =3D =
(UserTransaction)initCtx.lookup("java:comp/UserTransaction");
This works fine on J2EE Impementation Servers but fails on Tomcat 4.1.3. =
Exception:

javax.naming.NameNotFoundException: Name =
javax.transaction.UserTransaction is no
t bound in this Context
        at =
org.apache.naming.NamingContext.lookup(NamingContext.java:811)
        at =
org.apache.naming.NamingContext.lookup(NamingContext.java:194)
        at =
org.apache.naming.SelectorContext.lookup(SelectorContext.java:183)
        at javax.naming.InitialContext.lookup(InitialContext.java:347)



Thanks
Hassan


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org