This is a little frustrating because I've seen this question asked several times on 
forums, but none of the threads end with any resolution.

This is my problem:

I have set up a DataSource for MS SQL, and I can look it up successfully via:

Context iniCtx = new InitialContext();
Object o = iniCtx.lookup("java:testDS");

The object coming back is of type (org.jboss.resource.adapter.jdbc.WrapperDataSource). 
This object implements javax.sql.DataSource.

However, whenever I try to cast this objecft to javax.sql.DataSource (or use it as a 
parameter to a method expecting such), I get a ClassCastException.

BTW, "o instanceof javax.sql.DataSource" and 
"javax.sql.DataSource.class.isAssignableFrom( 
org.jboss.resource.adapter.jdbc.WrapperDataSource.class))" both return FALSE.

So. I understand this is a ClassLoader issue. BUT WHAT IS THE FIX!

My mssql-ds.xml file is in the /deploy directoy. I am accessing this DS from inside an 
EJB packaged in an EAR file.

Can someone make a post to this thread that contains a resolution???

Nate


View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3832106#3832106

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3832106


-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=12297
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to