Win a copy of Java Challengers this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

Transaction support in WAS 5.0

Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to access the UserTransaction api from my application client - for this case i am getting Naming Excetion
i.e. it is not able to look up
The error is as follows
#####Stack Trace ....
javax.naming.NameNotFoundException: Name "comp/UserTransaction" not found in context "java:".
at javax.naming.InitialContext.lookup(
at examples.DetailerClient.main(
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Native Method)

and my look up code is :
javax.transaction.UserTransaction ut = null;
InitialContext ctx = new InitialContext();
ut = (UserTransaction) ctx.lookup("java:comp/UserTransaction");
and package javax.transaction.* is also imported in the code;
After that i tried using bean level transaction on a stateless session bean , for that code is as follows :
EJBContext ejbctx = null;
javax.transaction.UserTransaction userTran = null;
System.out.println("Getting the user transaction object..............");
userTran = ejbctx.getUserTransaction();
System.out.println("GOT the user transaction object..............");
here i am getting the error at line - userTran = ejbctx.getUserTransaction();
that is before this line code is executed.. i am printing stacktrace also .. but it is not showing anything ..
i just want to know that do we need to make configuration settings for Transactions Support in WAS 5.0
if not - What can be the possible reason ?
I have only this entry for the transactions when i run
13 (top)/nodes/inril6/servers/server1/DefaultDatasource
Please respond back earliest
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic