2 Replies Latest reply on Jun 29, 2016 4:39 PM by Atul Kaushal

    DataSource class cast exception - WildFly-9.0.2.Final

    Atul Kaushal Newbie

      Hi,

      Application works fine in standalone mode but when I tried to deployed it in domain mode on wildfly-9.0.2.Final. It is throwing exception for datasource class conversion.I am using XA-Datasource and jdk version is 1.8 update 71.  I also tried by placing ojdbc6.jar in modules but still same issue. Any pointers will be helpful.

       

      Datasource details:

       

      <?xml version="1.0" encoding="UTF-8"?>

      <datasources xmlns="http://www.jboss.org/ironjacamar/schema">

        <xa-datasource jndi-name="csm" pool-name="csmDS" enabled="true" use-ccm="false" spy="true">

        <xa-datasource-property name="URL">jdbc:oracle:thin:@localhost:1521:xe</xa-datasource-property>

        <!--driver-class>oracle.jdbc.driver.OracleDriver</driver-class-->

        <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>

        <driver>ojdbc6.jar</driver>

        <security>

        <user-name>username</user-name>

        <password>password</password>

        </security>

        <xa-pool>

        <is-same-rm-override>false</is-same-rm-override>

        <min-pool-size>2</min-pool-size>

        <max-pool-size>30</max-pool-size>

        <prefill>true</prefill>

        <use-strict-min>true</use-strict-min>

        <no-tx-separate-pools />

        </xa-pool>

        </xa-datasource>

      </datasources>

       

      Exception:

      2016-05-18 11:26:15,028 ERROR [org.jboss.as.controller.management-operation] (ServerService ThreadPool -- 99) WFLYCTL0013: Operation ("read-attribute") failed - address: ([ ("deployment"=> "clinportal-ds.xml"), ("subsystem" => "datasources"), ("xa-data-source" => "csm") ]): java.lang.ClassCastException: org.jboss.jca.common.metadata.ds.DsXaPoolImpl cannot be cast to org.jboss.jca.common.api.metadata.ds.DsPool at org.jboss.as.connector.subsystems.datasources.XMLXaDataSourceRuntimeHandler.handleDatasourceAttribute(XMLXaDataSourceRuntimeHandler.java:146) at org.jboss.as.connector.subsystems.datasources.XMLXaDataSourceRuntimeHandler.executeReadAttribute(XMLXaDataSourceRuntimeHandler.java:54) at org.jboss.as.connector.subsystems.datasources.XMLXaDataSourceRuntimeHandler.executeReadAttribute(XMLXaDataSourceRuntimeHandler.java:43) at org.jboss.as.connector.subsystems.datasources.AbstractXMLDataSourceRuntimeHandler.executeRuntimeStep(AbstractXMLDataSourceRuntimeHandler.java:62) at org.jboss.as.controller.AbstractRuntimeOnlyHandler$1.execute(AbstractRuntimeOnlyHandler.java:53) at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:803) at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:601) at org.jboss.as.controller.AbstractOperationContext.completeStepInternal(AbstractOperationContext.java:354) at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:330) at org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1183) at org.jboss.as.controller.ModelControllerImpl.internalExecute(ModelControllerImpl.java:362) at org.jboss.as.controller.ModelControllerImpl.execute(ModelControllerImpl.java:218) at org.jboss.as.controller.remote.TransactionalProtocolOperationHandler.internalExecute(TransactionalProtocolOperationHandler.java:234) at org.jboss.as.controller.remote.TransactionalProtocolOperationHandler$ExecuteRequestHandler.doExecute(TransactionalProtocolOperationHandler.java:174) at org.jboss.as.controller.remote.TransactionalProtocolOperationHandler$ExecuteRequestHandler$1.run(TransactionalProtocolOperationHandler.java:137) at org.jboss.as.controller.remote.TransactionalProtocolOperationHandler$ExecuteRequestHandler$1.run(TransactionalProtocolOperationHandler.java:133) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:360) at org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:81) at org.jboss.as.controller.remote.TransactionalProtocolOperationHandler$ExecuteRequestHandler$2$1.run(TransactionalProtocolOperationHandler.java:153) at org.jboss.as.controller.remote.TransactionalProtocolOperationHandler$ExecuteRequestHandler$2$1.run(TransactionalProtocolOperationHandler.java:149) at java.security.AccessController.doPrivileged(Native Method) at org.jboss.as.controller.remote.TransactionalProtocolOperationHandler$ExecuteRequestHandler$2.execute(TransactionalProtocolOperationHandler.java:149) at org.jboss.as.protocol.mgmt.AbstractMessageHandler$2$1.doExecute(AbstractMessageHandler.java:298) at org.jboss.as.protocol.mgmt.AbstractMessageHandler$AsyncTaskRunner.run(AbstractMessageHandler.java:518) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.

      Thread.run(Thread.java:745) at org.jboss.threads.JBossThread.run(JBossThread.java:3