• Post Reply Bookmark Topic Watch Topic
  • New Topic

Very Urgent!. Please help me.

 
Pardhsaradhi Naraparaju
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am stuck up with UserTransaction JNDI lookup (with jta/usertransaction) in WebSphere 6 from standalone non J2EE application client JVM.

Client JVM has thrown the following exception while lookup:

May 24, 2005 11:49:47 AM com.ibm.ws.naming.util.Helpers
WARNING: jndiGetObjInstNoop
Exception in thread "P=586654 =0:CT" java.lang.ClassCastException: javax.naming.Reference

Both the WebSphere container and standalone client uses IBM JDK 1.4.2 and I have placed all necessary JAR files in the client's CLASSPATH, but still the ClassCastException resulted.

Below is the sample code of the application client:

Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");
props.put(Context.PROVIDER_URL, "iiop://localhost:2809");

Context ctx = new InitialContext(props);
javax.transaction.UserTransaction userTrans = (javax.transaction.UserTransaction) ctx.lookup("jta/usertransaction");
userTrans.begin();

Could anyone please look into this and let me know what went wrong with the lookup?

Thanks,
Pardha.
 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure if this will help you much, but why do you need to lookup the UserTransaction object? Usually the same could be achieved using the EJBContext:

Regards.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!