looking up datasource through client gives classcast excetion (websphere 5)(some guru solve this)
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Saturday, October 4, 2003 06:55 AM

HI, Any one help me out of this situation. I have configured the datasource through admin colsole with webshere5.0 I have a little client which looks up this configured JDBC connection pool resource like this : InitialContext ctx = new InitialContext(p/*Properties*/); /*This line returns the javax.naming.Reference Object and when I try to typecast this through PortableNarrowObject or otherwise directly it gives ClassCastException java.lang.Reference */ Object o = ctx.lookup("jdbc/Sample"); how do I get the javax.sql.DataSource some help from some guru will help me move forward. Thanks in advance    More>>

HI,
Any one help me out of this situation.

I have configured the datasource through admin colsole with webshere5.0

I have a little client which looks up this configured JDBC connection pool resource like this :

InitialContext ctx = new InitialContext(p/*Properties*/);
/*This line returns the javax.naming.Reference Object and when I try to typecast this through PortableNarrowObject or otherwise directly it gives ClassCastException java.lang.Reference */
Object o = ctx.lookup("jdbc/Sample");

how do I get the javax.sql.DataSource

some help from some guru will help me move forward.

Thanks in advance

   <<Less

Re: looking up datasource through client gives classcast excetion (websphere 5)(some guru solve this)

Posted By:   Nicholas_Whitehead  
Posted On:   Monday, October 6, 2003 05:48 AM

Naresh;

Make sure your client performing the lookup has javax.sql.Datasource and any other required classes in its classpath. The reference object you are retrieving is an object factory that will need a set of classes in order to build the cirrect objects. If the classes are not available, it will fail.

//Nicholas

About | Sitemap | Contact