2 Replies Latest reply on Oct 13, 2017 10:03 AM by Nicolas Maujean

    Jboss error New missing/unsatisfied dependencies jboss.naming.context.java.jboss.datasources

    Nicolas Maujean Newbie

      I have the following datasource, we are using oracle jdbc driver, ojdbc6.jar :

       

      <?xml version="1.0" encoding="UTF-8"?>
      <datasources xmlns="http://www.jboss.org/ironjacamar/schema">
       
      <datasource jndi-name="java:jboss/datasources/hubAdminDS" enabled="true"
        use-java-context
      ="true" pool-name="hubAdmin" jta="false">
        
      <connection-url>jdbc:oracle:thin:@10.0.153.177:1521:XE</connection-url>
        
      <driver>ojdbc6.jar</driver>
        
      <pool>
        
      <min-pool-size>5</min-pool-size>
        
      <max-pool-size>10</max-pool-size>
        
      <prefill>true</prefill>
        
      </pool>
        
      <security>
        
      <user-name>HUBDBLOCAL</user-name>
        
      <password>HUBDBLOCAL</password>
        
      </security>
       
      </datasource>


       
      <datasource jndi-name="java:jboss/datasources/TASK_DB" enabled="true"
        use-java-context
      ="true" pool-name="TASK_DB" spy="true" use-ccm="true">
        
      <connection-url>jdbc:oracle:thin:@10.0.153.177:1521:XE</connection-url>
        
      <driver>ojdbc6.jar</driver>
        
      <pool>
        
      <min-pool-size>10</min-pool-size>
        
      <max-pool-size>20</max-pool-size>
        
      <prefill>true</prefill>
        
      </pool>
        
      <security>
        
      <user-name>HUBDBLOCAL</user-name>
        
      <password>HUBDBLOCAL</password>
        
      </security>
       
      </datasource>

      <datasource jndi-name="java:jboss/datasources/SAFE" enabled="true" 
        use-java-context
      ="true" pool-name="SAFE" jta="false">
        
      <connection-url>jdbc:oracle:thin:@10.0.153.177:1521:XE</connection-url>
        
      <driver>ojdbc6.jar</driver>
        
      <pool>
        
      <min-pool-size>3</min-pool-size>
        
      <max-pool-size>4</max-pool-size>
        
      <prefill>true</prefill>
        
      </pool>
        
      <security>
        
      <user-name>HUBDBLOCAL</user-name>
        
      <password>HUBDBLOCAL</password>
        
      </security>
      </datasource>

      <datasource jndi-name="java:jboss/datasources/JDBC_DB" enabled="true"
        use-java-context
      ="false" pool-name="JDBC_DB" jta="false">
        
      <connection-url>jdbc:oracle:thin:@10.0.153.177:1521:XE</connection-url>
        
      <driver>ojdbc6.jar</driver>
        
      <pool>
        
      <min-pool-size>5</min-pool-size>
        
      <max-pool-size>10</max-pool-size>
        
      <prefill>true</prefill>
        
      </pool>
        
      <security>
        
      <user-name>HUBDBLOCAL</user-name>
        
      <password>HUBDBLOCAL</password>
        
      </security>
       
      </datasource>

       
      <datasource jndi-name="java:jboss/datasources/MAIL_SENDER_DB"
        enabled
      ="true" use-java-context="true" pool-name="MAIL_SENDER_DB"
        jta
      ="false">
        
      <connection-url>jdbc:oracle:thin:@10.0.153.177:1521:XE</connection-url>
        
      <driver>ojdbc6.jar</driver>
        
      <pool>
        
      <min-pool-size>3</min-pool-size>
        
      <max-pool-size>4</max-pool-size>
        
      <prefill>true</prefill>
        
      </pool>
        
      <security>
        
      <user-name>HUBDBLOCAL</user-name>
        
      <password>HUBDBLOCAL</password>
        
      </security>
       
      </datasource>

        
      <datasource jndi-name="java:jboss/datasources/HELPDESK" enabled="true"
        use-java-context
      ="true" pool-name="HELPDESK" jta="false">
        
      <connection-url>jdbc:oracle:thin:@10.0.153.177:1521:XE</connection-url>
        
      <driver>ojdbc6.jar</driver>
        
      <pool>
        
      <min-pool-size>10</min-pool-size>
        
      <max-pool-size>20</max-pool-size>
        
      <prefill>true</prefill>
        
      </pool>
        
      <security>
        
      <user-name>HUBDBLOCAL</user-name>
        
      <password>HUBDBLOCAL</password>
        
      </security>
        
      </datasource>
      </datasources>

       

      when I deploy the application, I got the following error :

       

      15:44:40,915 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2)
      JBAS014774
      : Service status report
      JBAS014775
      :  New missing/unsatisfied dependencies:
        service jboss
      .naming.context.java.jboss.datasources.JDBC_DB (missing) dependents: [service jboss.naming.context.java.module.bpm.bpm.env."com.hds.hub.api.processes.impl.UserServicesEJB".dataSource, service jboss.naming.context.java.module.bpm.bpm.env."com.hds.hub.iArchive.impl.FileArchiveServiceEJB".dataSource]
        service jboss
      .naming.context.java.jboss.datasources.MAIL_SENDER_DB (missing) dependents: [service jboss.naming.context.java.module.bpm.bpm.env.jdbc.MAIL_SENDER_DB]
        service jboss
      .naming.context.java.jboss.datasources.TASK_DB (missing) dependents: [service jboss.naming.context.java.module.bpm.bpm.env.jdbc.TASK_DB, service jboss.persistenceunit."bpm.war#org.jbpm.persistence.jpa"]
        service jboss
      .naming.context.java.jboss.datasources.hubAdminDS (missing) dependents: [service jboss.naming.context.java.module.bpm.bpm.env.jdbc.HUB_ADMIN_DB]

      15:44:40,921 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.naming.context.java.module.bpm.bpm.env.\"com.hds.hub.iArchive.impl.FileArchiveServiceEJB\".dataSourcejboss.naming.context.java.jboss.datasources.JDBC_DBMissing[jboss.naming.context.java.module.bpm.bpm.env.\"com.hds.hub.iArchive.impl.FileArchiveServiceEJB\".dataSourcejboss.naming.context.java.jboss.datasources.JDBC_DB]","jboss.naming.context.java.module.bpm.bpm.env.jdbc.HUB_ADMIN_DBjboss.naming.context.java.jboss.datasources.hubAdminDSMissing[jboss.naming.context.java.module.bpm.bpm.env.jdbc.HUB_ADMIN_DBjboss.naming.context.java.jboss.datasources.hubAdminDS]","jboss.naming.context.java.module.bpm.bpm.env.jdbc.TASK_DBjboss.naming.context.java.jboss.datasources.TASK_DBMissing[jboss.naming.context.java.module.bpm.bpm.env.jdbc.TASK_DBjboss.naming.context.java.jboss.datasources.TASK_DB]","jboss.naming.context.java.module.bpm.bpm.env.\"com.hds.hub.api.processes.impl.UserServicesEJB\".dataSourcejboss.naming.context.java.jboss.datasources.JDBC_DBMissing[jboss.naming.context.java.module.bpm.bpm.env.\"com.hds.hub.api.processes.impl.UserServicesEJB\".dataSourcejboss.naming.context.java.jboss.datasources.JDBC_DB]","jboss.naming.context.java.module.bpm.bpm.env.jdbc.MAIL_SENDER_DBjboss.naming.context.java.jboss.datasources.MAIL_SENDER_DBMissing[jboss.naming.context.java.module.bpm.bpm.env.jdbc.MAIL_SENDER_DBjboss.naming.context.java.jboss.datasources.MAIL_SENDER_DB]","jboss.persistenceunit.\"bpm.war#org.jbpm.persistence.jpa\"jboss.naming.context.java.jboss.datasources.TASK_DBMissing[jboss.persistenceunit.\"bpm.war#org.jbpm.persistence.jpa\"jboss.naming.context.java.jboss.datasources.TASK_DB]"]}}}

       

      JDBC_DB, MAIL_SENDER, TASK_DB and hubAdminDS are defined in the datasource

      When I connect to the remote server there is no error but when I connect to the local server I have the above errors.

      Anyone can explain, why I have thoses errors ? How I can correct it ?

        • 1. Re: Jboss error New missing/unsatisfied dependencies jboss.naming.context.java.jboss.datasources
          Anup Dey Apprentice

          It looks like your datasource ("java:jboss/datasources/JDBC_DB") is not properly deployed inside JBoss  server, Follow the below steps to get this done:

          Install a JDBC driver as a core module
          1. Create a directory under $JBOSS_HOME/modules. In this example: "$JBOSS_HOME/modules/com/oracle/jdbc/main".
          2. Put the the JDBC driver jar (ojdbc6.jar) in this directory
          3. Create a module configuration file module.xml:

           

          <module xmlns="urn:jboss:module:1.1" name="com.oracle.jdbc">
            <resources>
            <resource-root path="ojdbc6.jar"/>
            </resources>
            <dependencies>
            <module name="javax.api"/>
            <module name="javax.transaction.api"/>
            </dependencies>
          </module>

           

           

          Note that the jdbc driver jar must contain a META-INF/services/java.sql.Driver text file that specifies the jdbc Driver, otherwise the Java service provider mechanism used to load the driver will not work. From the main/common vendors only Informix does not have this out of the box.

          4.Configure a datasource setting in standalone.xml or domain.xml.

          You can now edit your standalone(-*).xml or domain(-*).xml to configure a datasource that references this module:

           

          <subsystem ....>
            <datasources>
            <datasource jndi-name="java:jboss/datasources/OracleDS" pool-name="OracleDS" enabled="true" use-java-context="true">
            <connection-url>jdbc:oracle:thin:@myhostname:1521:oracle</connection-url>
            <driver>oracle</driver>
            <pool>
            <min-pool-size>10</min-pool-size>
            <max-pool-size>20</max-pool-size>
            <prefill>true</prefill>
            </pool>
            <security>
            <user-name>myuser</user-name>
            <password>mypass</password>
            </security>
            <validation>
            <validate-on-match>true</validate-on-match>
            <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker"></valid-connection-checker>
            <stale-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker"></stale-connection-checker>
            <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter"></exception-sorter>
            </validation>
            </datasource>
            <drivers>
            <driver name="oracle" module="com.oracle.jdbc">
            <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
            </driver>
            </drivers>
            </datasources>
            </subsystem>

           

           

          or for an xa-datasource:

           

           

          <subsystem ...>
            <datasources>
            <xa-datasource jndi-name="java:/XAOracleDS" pool-name="XAOracleDS">
            <driver>oracle</driver>
            <xa-datasource-property name="URL">jdbc:oracle:thin:@myhostname:1521:oracle</xa-datasource-property>
            <security>
            <user-name>admin</user-name>
            <password>admin</password>
            </security>
            <xa-pool>
            <is-same-rm-override>false</is-same-rm-override>
            <no-tx-separate-pools />
            </xa-pool>
            <validation>
            <validate-on-match>true</validate-on-match> 
            <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker"></valid-connection-checker>
            <stale-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker"></stale-connection-checker>
            <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter"></exception-sorter>
            </validation>
            </xa-datasource>
            <drivers>
            <driver name="oracle" module="com.oracle">
            <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
            </driver>
            </drivers>
            </datasources>
            </subsystem>

           

           

           

          Once DB-Driver is set up as a module and  server log says below:

           

           

          12:10:47,381 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) JBAS010400: Bound data source [java:jboss/datasources/OracleDS]

          ...

          • 2. Re: Jboss error New missing/unsatisfied dependencies jboss.naming.context.java.jboss.datasources
            Nicolas Maujean Newbie

            0down voteaccept

            I needed to allow multiple connection to my database which was limited by the following command :

            sqlplus / as sysdba  
            ALTER SYSTEM SET PROCESSES= 300 SCOPE=SPFILE;
            SHUT IMMEDIATE
            ;
            STARTUP
            ;