Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

tomcat4.0 and UserTransaction

843833Sep 25 2001 — edited Mar 16 2002
hi,

in my project i am trying to get an instance of javax.transaction.UserTransaction in tomcat4.0 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" type="javax.transaction.UserTransaction"/>

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 mysql as database and mysql's type 4 jdbc2.0 compliant driver.

please suggest its urgent..

thanks in advance,

sachin walia
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 13 2002
Added on Sep 25 2001
2 comments
166 views