I am getting a rather interesting ClassCastException fior DataSource tied to a SQl Server connection. I am using the Opti driver, and setting up the connection using the *-ds.xml style settup file. Also, am running ver 3.2.1 of Jboss with Tomcat, compiled and ran on the 1.4. jdk/VM. Here is the issue; when the DataSource is obtained from jndi, and cast to a DataSource, there is a Class cast expepiton when the WrapperDataSource is cast. I have inserted quite a bit of debug material-- and here's the wierd part; The object returned is a WrapperDatasource object (not null) where debug lines say it implements the DataSource interface, but is NOT an instanceof DataSource. For a sanity check, I made sure we are talking about the DataSource in the right namespace. How is it possible that the object is a WrapeprDatasource that sure enough implemnts DataSource interface (as it should..along with Serializable, Referenceable, etc..), but is not an instance of DataSource? Experiments where I compile/run against 1.3 jdk/vm yield identical results.
Just wanted to post the fix for this issue. Or at least, the fix that worked for me. I removed just about all of the third party jar libs from the ear file. Iterestingly enough, none of them contained the DataSource class--- but it fixed the issue. I moved those files to the server/lib directory.