Jon Wingfield, thanks for your reply. My application is a Web Application (.war) only, no ejb's etc. However, since I'm using Composite View Pattern (aka Templating), I want different parts to be combined into One View, all in one transaction. This is done in a Servlet. Now if Tomcat doesn't provide a reference to an implementation of javax.transaction.UserTransaction, through JNDI lookup, then I believe there must be some other of doing this. e.g. Using a third party package that provides the implementation of javax.transaction api and plugging it in the application. Do you know of any?
Remember, after all this is on the Web Tier, Tomcat tier, there must be a way of doing it! Thanks Hassan ----- Original Message ----- From: "Jon Wingfield" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Tuesday, April 06, 2004 11:25 AM Subject: Re: Problem with UserTransaction reference within Servlet code. > The answer's in the question ;) > Tomcat is not a J2EE Server but an implementation of the Servlet > Specification (which is but a part of the whole J2EE spec). > Tomcat's JNDI lookups are in-process only. > > Need an open source J2EE container? Have a look at JBoss... > > Hassan Sajjad wrote: > > 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 .... > > > > There's a code snippet. > > > > Context initCtx = new InitialContext(); > > UserTransaction tx = (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 not 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 > > PREMIER HOUSEWARES > > Premier Business Park, 55 Jordanvale Avenue > > Whiteinch Glasgow G14 0QP > > UK > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]