1 Reply Latest reply on Oct 29, 2003 9:31 AM by puravidaaustin

    Iteresting ClassCastException for DataSource

    puravidaaustin

      Hello all;
      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.
      Cheers, Will-