2 Replies Latest reply: Jul 27, 2013 8:16 AM by Manish RSS

    Exception:org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper cannot be cast to oracle.jdbc.OracleConnection

    Manish

      Hi All,

       

      i am using jdev version 11.1.1.5.0

      and deployed my Adf application on Apache Tomcat 6.0.

       

      1. in my use case i have created simple adf application using adf business component. create a vo based on eo and drag-drop on jspx page.
      2. i have created JNDI data source in Apache server using edit context.xml file and add following line-

      <Resource name="jdbc/TestDB" auth="Container"

                    type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver"

                    url="jdbc:oracle:thin:@localhost:1521:dst"

                    username="jagrandb" password="jagrantest" maxActive="20" maxIdle="10"

                    maxWait="-1"  accessToUnderlyingConnectionAllowed="true" />

      3.using same data source in my adf applicatioin as -

        right click on AM --> Configuration-->edit-->select connection type jdbc datasource  -->java:/comp/env/jdbc/TestDB  

       

      4. after that i have deployed my application on apace server but when i have running application i have got following error-

      org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper cannot be cast to oracle.jdbc.OracleConnection

       

      i have goggling and find  following solution-

      oracle.jdbc.driver.OracleConnection delConn = (oracle.jdbc.driver.OracleConnection) ((org.apache.tomcat.dbcp.dbcp.DelegatingConnection)c_stmt.getConnection()).getDelegate();

       

      but my problem is that i'm using Adf Business Component so where i set following type casting.

      Is there any method on ADF BC which handle JNDI Data source setting or any other way to do this.

       

      thanks in Advance

       

      Manish