File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes User Txn - Lookup problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "User Txn - Lookup problem" Watch "User Txn - Lookup problem" New topic

User Txn - Lookup problem

Shivaji Bhosale
Ranch Hand

Joined: Mar 12, 2001
Posts: 70
From my simple Java Class client, I want to initiate User Txn. Server CMPs have Txn attributes as TX_REQUIRED.
Say I am carrying out 5 Txns, & say 3rd one is failed, then previous 2 must be rolled back & next Txns must be abandoned.
Since my client is not a Session Bean, I have code like this, for having UserTransaction.
Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY, factory);
ht.put(Context.PROVIDER_URL, url);
InitialContext ctx = new InitialContext(ht);
javax.transaction.UserTransaction userTrans =
But at this lookup I get an error NoSuchNameFoundException.
Right now I am doing this all in IBM VAJ which is having Websphere Test Environment. I have Name Server & Bean Servers running.
What is the problem? If URL is wrong ?
Waiting eagerly for replies...
Kyle Brown
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
The JNDI name isn't right. Lookup "jta/usertransaction" instead.

Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at for other WebSphere information.

Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at for other WebSphere information.
I agree. Here's the link:
subject: User Txn - Lookup problem
It's not a secret anymore!