First off, I know what this problem is. Yes, the class trying to grab the DataSource is running on a different JVM (aka stand alone client). Yes, my classpath is set properly.
My question is if there is anyway to grab a DataSource object from WAS from a stand alone client.
Basically I have a Session bean that relies on a helper class for all it's logic. I then have jUnit tests that directly test this helper class (I do it this way so I can perform more specific low-level checking, rathering than performing tests using high level operations). The problem is the helper class uses a Data Access class that utilizes the App Server's JDBCDataSource (in production this class will reside in the Application's JVM so normally its fine). So when the Data Access class is being initialized (doing the JNDI lookup) it fails because it is getting back a javax.naming.Refernce rahter than a DataSource objct.
So, is it possible in WAS 5.1.x to directly grab a DataSource from a class running in a seperate JVM? My guess is no and it seems IBM also has documentation that says this is not possible:
Anyways, I guess i'm looking for options or some kind of input. Another reason this bothers me is the same jUnit test runs absolutely fine against Weblogic8.1 . Why can't WAS be as forgiving as Weblogic?? It's always something with WAS.
Java has 99 problems but a pointer ain't one
Joined: Mar 05, 2002
Good news: There is a work around. Bad News: It's EJB.
Joined: Mar 13, 2005
Originally posted by Patrick Finnegan: Good news: There is a work around. Bad News: It's EJB.