Select Your Language

Infrastructure and Management

Cloud Computing

Storage

Runtimes

Integration and Automation

  • Comments
  • java.lang.ClassCastException: org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6 cannot be cast to oracle.jdbc.OracleConnection

    Posted on

    We are getting ClassCastException org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6 cannot be cast to oracle.jdbc.OracleConnection
    while using the Data Source with Jboss EAP 6.3

    Below are the configuration details :

    Java version : 1.7
    Oracle : 12c (ojdbc7.jar)
    Jboss : EAP 6.3
    Exception : org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6 cannot be cast to oracle.jdbc.OracleConnection
    We make sure that there is only one version of the Oracle (only ojdbc7.jar) we dont have classes12.jar in the project build path.

    Added the following in my jboss-deployment-structure.xml for my WAR deployment even thought still getting the exception as below:

    
       
            
                
            
        
    
    
    DataSource Creation:
         InitialContext ctx = null;
         DataSource dataSource = null;
         try {
          if (conn == null) {
              logger.debug("In DbConnectionFactory.getDataSource() After InitialContext");
          dataSource = (DataSource)new InitialContext().lookup("java:jboss/datasources/TestDS");
          conn = dataSource.getConnection();
          conn.setAutoCommit(false);
        }   
    
    

    This below line throws the class cast exception .

     Array array_to_pass = ((OracleConnection)conn).createOracleArray("STRING_ARRAY",testArray);
    

    ** Please do let us know what is wrong with this configuration ?**

    by

    points

    Responses

    Red Hat LinkedIn YouTube Facebook X, formerly Twitter

    Quick Links

    Help

    Site Info

    Related Sites

    © 2026 Red Hat