3 Replies Latest reply on Feb 8, 2008 2:27 AM by jaikiran pai

    PB with wrapping my oracledatasource

    joe lindien Newbie

      hi,
      I'm trying to use an Oracledatasource to acces my db from a servlet but I' have an error:
      java.lang.ClassCastException: org.jboss.resource.adapter.jdbc.WrapperDataSource

      here is my code:
      Context ctx;

      try {
      ctx = new InitialContext();
      OracleDataSource ds;
      ds = (OracleDataSource) ctx.lookup("java:OracleDS");

      OracleConnection connection;
      try {
      connection = (OracleConnection) ds.getConnection();
      PrintWriter out = reponse.getWriter();
      ....
      .....
      The line that bug is underlined, it seems that I Can't cast anything with an oraclesomething whatever it's an oracleconnection, oracledatasource etc..
      I think my datasource is well configured (see below)


      <local-tx-datasource>
      <jndi-name>OracleDS</jndi-name>
      <connection-url>jdbc:oracle:thin:@localhost:1521:ORCL</connection-url>
      <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
      <user-name>jeremy</user-name>
      taeslin <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>

      <type-mapping>Oracle9i</type-mapping>

      </local-tx-datasource>


      So if anybody could help me, i would be very pleased :)