3
votes

I am trying to deploy Wildfly 10 for a JSF-EJB project.

I have my oracle.jdeveloper.db.connection.jar defined in my Library in eclipse(4.4.0) and placed ojdbc6.jar in the following path C:\wildfly\wildfly-10.0.0.Final\modules\system\layers\base\com\oracle\main with module.xml.

I have successfully tested the datasource from localhost:9990/console

Below is my web.xml reference:

<resource-ref>
    <description>DB Connection</description>
    <res-ref-name>java:/OracleDS</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>  
    <res-auth>Container</res-auth>  
    <res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>  

I am using the following Datasource in the standalone.xml

        <datasources>
            <datasource jndi-name="java:/OracleDS" pool-name="OracleDS" enabled="true" use-java-context="true">
                <connection-url>jdbc:oracle:thin:@localhost:1521:xe</connection-url>
                <driver>oracle</driver>
                <pool>
                    <min-pool-size>1</min-pool-size>
                    <max-pool-size>5</max-pool-size>
                    <prefill>true</prefill>
                </pool>
                <security>
                    <user-name>Example</user-name>
                    <password>XXX</password>
                </security>
            </datasource>
            <drivers>
                <driver name="oracle" module="com.oracle">
                    <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
                </driver>
            </drivers>
        </datasources>

I am using the following line in module.xml:

<module xmlns="urn:jboss:module:1.3" name="com.oracle">

    <resources>
        <resource-root path="ojdbc6.jar"/>
    </resources>
    <dependencies>
        <module name="javax.api"/>
        <module name="javax.transaction.api"/> 
        <module name="javax.servlet.api" optional="true"/>
    </dependencies>
</module>

During deployment I receive the 2 following errors. Both are related with the Datasource:

17:20:19,404 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.deployment.unit."test11_R_Copy.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."test11_R_Copy.war".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of deployment "test11_R_Copy.war" at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:154) at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) 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) Caused by: java.lang.IllegalArgumentException: WFLYEE0047: Incompatible conflicting binding at java:/OracleDS source: lookup (java:comp/DefaultDataSource) at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor.addJndiBinding(ModuleJndiBindingProcessor.java:238) at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor.deploy(ModuleJndiBindingProcessor.java:107) at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147) ... 5 more

The following ERROR also refers to the Datasource.

17:20:19,419 ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 2) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "test11_R_Copy.war")]) - failure description: { "WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"test11_R_Copy.war\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"test11_R_Copy.war\".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of deployment \"test11_R_Copy.war\" > Caused by: java.lang.IllegalArgumentException: WFLYEE0047: Incompatible conflicting binding at java:/OracleDS source: lookup (java:comp/DefaultDataSource)"}, "WFLYCTL0180: Services with missing/unavailable dependencies" => [ "jboss.deployment.unit.\"test11_R_Copy.war\".batch.environment is missing [jboss.deployment.unit.\"test11_R_Copy.war\".beanmanager]", "jboss.deployment.unit.\"test11_R_Copy.war\".weld.weldClassIntrospector is missing [jboss.deployment.unit.\"test11_R_Copy.war\".beanmanager]"

I am not using the persistence.xml.

Where am I doing wrong?

Thank you.

2
I'm not a naming expert, but maybe try removing the reference from your web.xml. It should be seen already by the deployment by the way it's configured.James R. Perkins
@James thank you. This is where the issue was I changed the xml tag it worked. I will publish the solution.LEK

2 Answers

3
votes

Comment the resource-ref element in web.xml and everything works just fine.

<!-- <resource-ref> <description>DB Connection</description> <res-ref-name>java:/OracleDS</res-ref-name> <res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope> </resource-ref>
-->

0
votes

It solved by replacing <resource-ref> by <resource-env-ref>