0 Replies Latest reply on Sep 25, 2004 3:14 PM by Scott Streit

    jdbc oracle Jboss 4.0  ClassCastException

    Scott Streit Newbie

      I have code that worksin Jboss 3.x.

      The breit appears in the jms-console as jdbc with a name of breit.

      When I make the following call:

      System.out.println(" getConnection 1");
      InitialContext jndiCntx = new InitialContext();
      System.out.println(" getConnection 2");
      Object o = jndiCntx.lookup("java:/breit");
      System.out.println(" Object class is " + o.getClass().getName());
      DataSource ds = (DataSource) o;
      System.out.println(" getConnection 3");
      return ds.getConnection();

      The Object o has a name of
      2004-09-25 15:03:32,739 INFO [STDOUT] Object class is org.jboss.resource.adapter.jdbc.WrapperDataSource

      Why wiill this not cast into a java.sql.DataSource?

      Scott