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 ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

Transaction support in WAS 5.0

 
Greenhorn
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 com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpace.java:1003)
at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1211)
at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1203)
at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1257)
at javax.naming.InitialContext.lookup(InitialContext.java:345)
at examples.DetailerClient.main(DetailerClient.java:27)
at java.lang.reflect.Method.invoke(Native Method)
at com.ibm.websphere.client.applicationclient.launchClient.createContainerAndLaunchApp(launchClient.java:616)
at com.ibm.websphere.client.applicationclient.launchClient.main(launchClient.java:420)
at java.lang.reflect.Method.invoke(Native Method)
at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:94)

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;
2.
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 dumpnamepace.sh
(top)/nodes/inril6/servers/server1/TransactionFactory
12 com.ibm.ejs.jts.jts.ControlSet$LocalFactory
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
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic