3 Replies Latest reply on Jul 17, 2014 9:49 AM by lafr

    Services with missing/unavailable dependencies error in JBoss EAP 6.2.0.GA

    yogesh.agrawal

      I am trying to migrate my project war from Tomcat 6 to JBoss EAP 6.2.0. When trying to deploy the war I am getting the following exception:

       

       

      16:58:58,493 WARN [org.jboss.as.ee] (MSC service thread 1-4) JBAS011001: Could not resolve resource-env-ref java:/mwdb 16:58:58,568 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-8) JBAS010403: Deploying JDBC-compliant driver class com.microsoft.sqlserver.jdbc.SQLServerDriver (version 4.0) 16:58:58,787 ERROR [org.jboss.as.server] (HttpManagementService-threads - 1) JBAS015870: Deploy of deployment "csc.war" was rolled back with the following failure message: {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.naming.context.java.module.csc.csc.env.jdbc.mwdb is missing [jboss.naming.context.java.jboss.resources.jdbc.mwdb]"]}

       

       

      I am using MSSQL server as database and following is the configuration in my standalone.xml file.

       

       

      <datasources>

                  <datasource jta="true" jndi-name="java:/mwdb" pool-name="jdbc/mwdb" enabled="true" use-java-context="true" use-ccm="true">

                      <connection-url>jdbc:sqlserver://<ServerIP>\\<Instance>:<port>;Database=MWDB</connection-url>

                      <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>

                      <driver>sqlserver</driver>

                      <pool>

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

                          <max-pool-size>20</max-pool-size>

                          <prefill>true</prefill>

                      </pool>

                      <security>

                          <user-name>admin</user-name>

                          <password>admin</password>

                      </security>

                      <validation>

                          <check-valid-connection-sql>SELECT 1</check-valid-connection-sql>

                          <validate-on-match>false</validate-on-match>

                          <background-validation>false</background-validation>

                          <use-fast-fail>false</use-fast-fail>

                      </validation>

                  </datasource>

                  <drivers>

                      <driver name="sqlserver" module="com.microsoft.sqlserver.jdbc">

                          <datasource-class>com.microsoft.sqlserver.jdbc.SQLServerDataSource</datasource-class>

                      </driver>

                  </drivers>

              </datasources>

      I have placed sqljdbc4.jar and module.xml at jboss-as\modules\com\microsoft\sqlserver\jdbc\main.

       

       

      My module.xml reads as follows:

       

       

      <module xmlns="urn:jboss:module:1.1" name="com.microsoft.sqlserver.jdbc">

        <resources>

          <resource-root path="sqljdbc4.jar"/>

        </resources>

        <dependencies>

          <module name="javax.api"/>

          <module name="javax.transaction.api"/>

        </dependencies>

      </module>

       

       

      I have searched a lot about this issue in last two days and tried many things but nothing seems to work.

        • 1. Re: Services with missing/unavailable dependencies error in JBoss EAP 6.2.0.GA
          adila01

          My organization also embedded the sql server jar. I notice some minor differences. Maybe what we did could help.

          • I see that you places your sqljdbc4.jar at modules/com/microsoft/sqlserver/jdbc/main. When my organization embedded the sql server jar we placed it under $JBOSS_HOME/modules/system/layers/base/com/microsoft/sqlserver/jdbc/main
          • Our JNDI are of the form java:jboss/datasources/(name of the DS)

           

          Hopefully, this will help

          • 2. Re: Services with missing/unavailable dependencies error in JBoss EAP 6.2.0.GA
            yogesh.agrawal

            Thanks for responding. I placed the jar at the location you mentioned but still getting the same error. The logs are printing "Deploying JDBC-compliant driver class com.microsoft.sqlserver.jdbc.SQLServerDriver (version 4.0) " which gives me an impression that it is able to pick the jar properly but somehow not able to pick the jndi context.

            • 3. Re: Services with missing/unavailable dependencies error in JBoss EAP 6.2.0.GA
              lafr

              Location of module, with or without "system/layers/base" makes no difference as far as I know.

              I wonder why you see "Deploying JDBC-compliant driver class com.microsoft.sqlserver.jdbc.SQLServerDriver (version 4.0) " when your application deploys. I'd expect to see it earlier.

              The extract from server.log in your first post was from server startup?

              I'd expect to see the module message first and web-app deployment message later.

               

              Try startup without your application deployed.

              Got to the web-console, JNDI-view and see what's the final jndi name of the module.

               

              Then show us, how you use it in your code. I see "resource-env-ref java:/mwdb".

              Annotations or xml config files?