5 Replies Latest reply on Aug 10, 2017 1:53 PM by xiao cheng

    Services with missing/unavailable dependencies EAP6.4

    xiao cheng Newbie

      Hey guys, I will try to provide as many details as possible to to you hoping that the issue can be resolved sometimes soon.



      1. JBoss EAP 6.4 running on one virtual machine
      2. Microsoft SQL server developer edition 2014 running on a different virtual machine.
        1. TCP/IP is enabled thru Sql Server Configuration Manager
        2. I have added an database called example owned by User prototype with password goforit and authentication mode is set to SQL Server Authentication
        1. We originally use built-in H2 database for testing and now would like to test it with ms SQL server which is closer to our final setup.



      persistence.xml file:

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


      <persistence xmlns="http://java.sun.com/xml/ns/persistence"






        <persistence-unit name="obps" transaction-type="JTA">

            <description>Forge Persistence Unit</description>














            <!--  <exclude-unlisted-classes>false</exclude-unlisted-classes>-->


                <!-- Use option "update" so that data from previous runs remains in database /-->

                <property name="hibernate.hbm2ddl.auto" value="update"/>

                <!--property name="hibernate.hbm2ddl.auto" value="create"/-->

                <property name="hibernate.dialect" value="org.hibernate.dialect.SQLServer2012Dialect"/>

                <property name="hibernate.show_sql" value="true"/>

                <!--  property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/>-->





      data source file not working (MS SQL)


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





                use-java-context="true" pool-name="ExampleDSExternal">











      The below data source file is for H2 database configuration and everything works.

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

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




              use-java-context="true" pool-name="ExampleDSExternal">










          <driver name='h2' module="com.h2database.h2">






      The error output when trying to deploy the application on the server

      "{\"JBAS014771: Services with missing/unavailable dependencies\" => [\"jboss.persistenceunit.\\\"OBPS_CPM.war#obps\\\" is missing [jboss.naming.context.java.jboss.datasources.ExampleDSExternal]\"]}"


      I am suspecting that either the data source xml file configuration is not correct, or the access to the developer edition of SQL server is not set up properly because I do not know the ins and outs of it. So my question is, is there any issue with my data source file or the persistence.xml file? or do you think I have not set up the SQL server properly to be connected externally? For example, should I choose windows authentication or the SQL server authentication and how does it affect my data source configuration?


      I also learnt recently that you can configure the connection to the database thru standalone.xml file. What are the pros/cons of doing it as opposed to the approach I am using right now??


      Sorry to bombard you with questions and hopefully I can resolve the issue soon. Thank you!

        • 1. Re: Services with missing/unavailable dependencies EAP6.4
          xiao cheng Newbie

          Bump can anyone provide some help please?

          • 2. Re: Services with missing/unavailable dependencies EAP6.4
            xiao cheng Newbie

            Hey guys, a quick update. I tested the connection to the SQL server instance from my application server and the connection was successful, which means I can rule out the possibility that it is a SQL server configuration error.



            • 3. Re: Services with missing/unavailable dependencies EAP6.4
              john B Newbie

              Have you tried turning it off and on?

              • 4. Re: Services with missing/unavailable dependencies EAP6.4
                Paul Anom Newbie

                The *-ds.xml files are not used in Jboss eap 6 and 7 anymore. So you have to add the data source (and jdbc driver) to the configuration xml. If you use the standalone.xml you add it there. Rename, remove or comment out the H2 datasource definition.

                I prefer to apply all changes on the configuration by cli scripts. I do not have a mssql database example for you but for Oracle.


                NOTE. I remove existing definitions first to avoid error messages rerunning a cli script

                NOTE. You have to copy the jdbc driver in de modules directory tree and provide a module.xml, see Administration and Configuration Guide

                NOTE you can also deploy a jdbc driver


                #### driver.cli #####

                if (outcome == success) of /subsystem=datasources/jdbc-driver=oracle:read-resource




                /subsystem=datasources/jdbc-driver=oracle:add(driver-module-name=com.oracle.ojdbc, driver-name=oracle, driver-xa-datasource-class-name=oracle.jdbc.xa.client.OracleXADataSource)



                #### datasource.cli ####

                if (outcome == success) of /subsystem=datasources/data-source=EXAMPLE:read-resource



                /subsystem=datasources/data-source=EXAMPLE:add( \

                    jndi-name="java:/ExampleDS", \

                    connection-url=jdbc:oracle:thin:@myhost.intern:1520:EXAMPLE, \

                    user-name=example, \

                    password="${VAULT::EXAMPLE::password::1}", \

                    use-java-context=false, \

                    check-valid-connection-sql="select 1 from dual", \

                    min-pool-size=2, \

                    max-pool-size=50, \

                    driver-name=oracle, \





                #reload server to apply changes


                1 of 1 people found this helpful
                • 5. Re: Services with missing/unavailable dependencies EAP6.4
                  xiao cheng Newbie

                  Hey Paul I was able to get it to work last night. I will post my solution one of these days.

                  But essentially things I missed are:


                  1. I didnt know that one has to install the vendor specific JDBC driver as a core module. (I thought I can just drop the jar file in the build path and Voila it would work).

                  2. Like you point out, looks like data source are all being configured in the standalone.xml or domain.xml based on deployment scheme.

                  3. My connection url link is not correct, the port number should be 1433 instead of 1443.


                  Some additional questions, are there any good documents I can read up for further understanding of relationship between persistence.xml, -ds.xml, and standalone.xml? Can I still use -ds.xml if I choose to and what will be the disadvantage of using it (other than having a separate file)?


                  Thanks again!