Win a copy of Head First Android this week in the Android 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Problems in JNDI Lookup in Websphere 5.02

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I am currently deploying an application on Websphere Appserver 5.02. This was earlier developed on JBOSS. We are supposed to support this application on Websphere app server. I am facing too many problems in jndi lookups . First I faced problems in looking up datasources. Problem is Websphere uses prefixes such as jdbc, mail ,etc for jndi regsitered objects whereas Weblogic does not.
Some where within my code, there is a jndi lookup for TransactionManager object. Pleaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaase let me know how do I lookup this object. First let me know whether this object is available by default in Websphere. In Weblogic and Jboss this object is available by default and can be looked up by using javax.transaction.TransactionManager and java:/TransactionManager respectively. I have tried most of the possibilities, but I am not able to get the TransactionManager object in Websphere. I am getting NameNotFoundException along with a vague NoSuchMethodError . Currently, I have commented that piece of code, tried creating my own TransactionManger object using Websphere's TransactionManagerFactory class. But I am gettng a different error in the application.
Well, the application is of my client's where we we can't do major changes in the application. So let me know how do I look up the TransactionManager in Websphere5.02
thanks in adv,
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Geez. This sounds incredibly dangerous. What on earth do you need to get to the TransactionManager for? That's WAY, WAY outside the accepted use of the EJB spec -- WebSphere certainly will NOT allow you to get to the internals of it's JTA implementation like that. I mean good night, the very class comment in the Java doc for that class says "The TransactionManager interface defines the methods that allow an application server to manage transaction boundaries. " This is NOT meant to be an API that programs can manipulate!
If all you want to do is to commit or rollback a transaction, use UserTransaction insead. In WebSphere, as according to the EJB 2.0 specification, section 17.6, the JNDI name you must use to get to the UserTransaction is "java:comp/UserTransaction".
Kyle
[ November 21, 2003: Message edited by: Kyle Brown ]
 
prashanth nagaraj
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Brown,
I was doing lots of investigation , so could not reply for ur mail.
You are saying TransactionManager should be not tried to lookup at all.
As I had told earlier, the application is of our client. The TransactionManager object is looked up there to get javax.transaction.Transaction(tx) object . This registerSynchronization method in tx object is being invoked by passing an object X. This X class implements javax.transaction.Synchronization interface and overrides beforeCompletion and afterCompletion method. In after Completion method , he is calling org.apache.jcs.JCS class. After this The problem the person who wrote this code is on leave because of which I am not able to get any help regarding why TransactionManager is looked up.
Alternatively, Please let me know how do I still lookup the TransactionManager object in Websphere Appserver 5.02.
 
Ranch Hand
Posts: 1551
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does your application have a session bean that implements the SessionSynchronization interface?
 
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