tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vicky Tao" <>
Subject how to use javax.transaction.UserTransaction
Date Thu, 28 Feb 2002 07:01:10 GMT


in my project i am trying to get an instance of javax.transaction.UserTransaction in 
tomcat4.0.1 using jndi.

i have added the following tag in my server.xml for this regard as well as in web.xml 
as it is mentioned in the docs of tomcat4.0

  <Resource name="jta/UserTransaction" auth="Container" 

when in my JSP application i try to retrieve the instance it throws an exception on 
browser that says

Exception Report:
javax.servlet.ServletException: Cannot create resource instance
Root Cause:javax.naming.NamingException: Cannot create resource instance

the code i hve written in jsp page is::

Context ctx1 = new InitialContext();
Context ctx2 = (Context)ctx1.lookup("java:comp/env");
UserTransaction ut = (UserTransaction)ctx2.lookup("jta/UserTransaction");

any idea what shud be done to mend this..

BTW i am using MSSQL7 as database.

please suggest its urgent..

thanks in advance,
Vicky Tao

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message