3 Replies Latest reply on May 31, 2012 1:09 PM by bcantrick

    7.1.1-Final: Confusing error message. "Missing dependency" on datasource which is present?

    bcantrick

      I'm seeing the following in the server log:

       

      11:14:13,017 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-24) JBAS015876: Starting deployment of "testcase.war"

      11:14:16,775 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-5) Class Path entry jaxp-api.jar in "/home/bcantrick/jboss/jboss-as-7.1.1.Final/standalone/deployments/testcase.war/WEB-INF/lib/saaj-api.jar"  does not point to a valid jar for a Class-Path reference.

      [9 lines removed]

      11:14:16,794 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-5) Class Path entry xsdlib.jar in "/home/bcantrick/jboss/jboss-as-7.1.1.Final/standalone/deployments/testcase.war/WEB-INF/lib/msv.jar"  does not point to a valid jar for a Class-Path reference.

      11:14:17,344 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-17) JBAS015893: Encountered invalid class name 'org.xmlpull.mxp1.MXParser,org.xmlpull.mxp1_serializer.MXSerializer' for service type 'org.xmlpull.v1.XmlPullParserFactory'

      11:14:18,686 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) JBAS010403: Deploying JDBC-compliant driver class com.microsoft.sqlserver.jdbc.SQLServerDriver (version 3.0)

      11:14:18,851 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) JBAS010400: Bound data source [app/datasources/appPoolTx]

      11:14:19,119 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "testcase.war" was rolled back with failure message {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.naming.context.java.module.testcase.testcase.env.mainPoolTxjboss.naming.context.java.app.testcase.datasources.appPoolTxMissing[jboss.naming.context.java.module.testcase.testcase.env.mainPoolTxjboss.naming.context.java.app.testcase.datasources.appPoolTx]"]}

      11:14:19,205 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) JBAS010409: Unbound data source [app/datasources/appPoolTx]

      11:14:19,313 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015877: Stopped deployment testcase.war in 194ms

      11:14:19,321 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report

      JBAS014775:    New missing/unsatisfied dependencies:

            service jboss.naming.context.java.app.testcase.datasources.appPoolTx (missing) dependents: [service jboss.naming.context.java.module.testcase.testcase.env.mainPoolTx]

      11:14:19,329 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.testcase.testcase.env.mainPoolTxjboss.naming.context.java.app.testcase.datasources.appPoolTxMissing[jboss.naming.context.java.module.testcase.testcase.env.mainPoolTxjboss.naming.context.java.app.testcase.datasources.appPoolTx]"]}}}

       

       

      The part I can't figure out is the dependency error message. I've parsed it out thusly:

       

      {"JBAS014771: Services with missing/unavailable dependencies" => [

       

      "jboss.naming.context.java.module.testcase.testcase.env.mainPoolTx

      jboss.naming.context.java.app.testcase.datasources.appPoolTx

      Missing

      [jboss.naming.context.java.module.testcase.testcase.env.mainPoolTx

      jboss.naming.context.java.app.testcase.datasources.appPoolTx]

      "]}

       

      I can't tell for certain what this is supposed to mean. Is this telling me that env.mainPoolTx depends on datasources.appPoolTx? Or the other way around? Or is this trying to tell me that both env.mainPoolTx and datasources.appPoolTx depend on... themselves?

       

      If env.mainPoolTx depends on datasources.appPoolTx (which is what I intended), why is there an error? The logs clearly show that "Bound data source [app/datasources/appPoolTx]" happens before the error. Any dependency that env.mainPoolTx has on datasources.appPoolTx would seem to be satisfied.

       

      Am I missing something obvious here?

        • 1. Re: 7.1.1-Final: Confusing error message. "Missing dependency" on datasource which is present?
          ctomc

          Hi,

           

          application expects datasource to be bound to java:app/testcase/datasources/appPoolTx

          but you have it bound to app/datasources/appPoolTx

           

          just fix the configuration that refers to jndi name of your datasource and it should work.

          • 2. Re: 7.1.1-Final: Confusing error message. "Missing dependency" on datasource which is present?
            bcantrick

            Hi Tomaz!

             

            > application expects datasource to be bound to

             

            Just to be clear: This is a deploy error. No application code is ever run.

             

            > java:app/testcase/datasources/appPoolTx

             

            I went into my -ds.xml and jboss-web.xml and changed my <jndi-name>s to "java:app/testcase/datasources/appPoolTx". Error is still pretty much the same:

             

             

            09:33:42,190 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-17) JBAS010400: Bound data source [app/testcase/datasources/appPoolTx]

             

            09:33:42,477 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "testcase.war" was rolled back with failure message

            {"JBAS014771: Services with missing/unavailable dependencies" =>

            ["jboss.naming.context.java.module.testcase.testcase.env.mainPoolTx

              jboss.naming.context.java.app.testcase.testcase.datasources.appPoolTx

            Missing

            [jboss.naming.context.java.module.testcase.testcase.env.mainPoolTx

            jboss.naming.context.java.app.testcase.testcase.datasources.appPoolTx]

            "]}

             

            09:33:42,583 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-17) JBAS010409: Unbound data source [app/testcase/datasources/appPoolTx]

            09:33:42,646 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-12) JBAS015877: Stopped deployment testcase.war in 170ms

             

             

            I also tried it with use-java-context="true" in my -ds.xml file. No apparent change in the error:

             

            09:43:30,132 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-6) JBAS010400: Bound data source [app/testcase/datasources/appPoolTx]

             

            09:43:30,358 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "testcase.war" was rolled back with failure message

            {"JBAS014771: Services with missing/unavailable dependencies" =>

            ["jboss.naming.context.java.module.testcase.testcase.env.mainPoolTx

              jboss.naming.context.java.app.testcase.testcase.datasources.appPoolTx

            Missing

            [jboss.naming.context.java.module.testcase.testcase.env.mainPoolTx

            jboss.naming.context.java.app.testcase.testcase.datasources.appPoolTx]

            "]}

             

            I've attached the server.log files from both runs.

            • 3. Re: 7.1.1-Final: Confusing error message. "Missing dependency" on datasource which is present?
              bcantrick

              I think I know what was going wrong. The symptom is shown above - missing dependency error. However, I think the root cause is more subtle. What I believe I'm seeing is that the java:app, java:module and java:comp JNDI contexts are not created/available/whatever until after the -ds.xml is processed. Ergo, any attempt to use a java:app, java:module or java:comp JNDI name in the -ds.xml will fail. Because that would be trying to create a JNDI name in a JNDI context that doesn't exist (yet).

               

              Now, I haven't single-stepped through the JBoss code or anything of that nature, so the above is just speculation. But what I can tell you for certain is that when I use a JNDI name starting with java:global or java:jboss, everything starts working. This works because those JNDI contexts are always present. Thus it is always possible to create a JNDI name in them.

               

              This is actually kind of disappointing, because I was hoping to use JNDI names in java:app for my connection pools. That way the JNDI pool names would would be in a JNDI context that is unique to my .war file. This would avoiding any possiblity of naming conflict(s) with other apps.But no such luck.

               

              So, to try and minimize the chances of conflict, I settled on a naming scheme like: "java:jboss/datasources/our_product_name/pool_name".  The idea here is that even though I'm using a JNDI context ("java:jboss.datasources/") that all apps on the same JBoss instance can read and write, at least I'm prefixing our pool names with a (hopefully) unique prefix. As long as nobody else picks the same prefix, there should be no conflicts.

               

              Also, by putting my -ds.xml file inside my .war file, the pools (and their JNDI names) will come and go as my .war is loaded and unloaded. Hopefully that will aid in the diagnosis of any naming conflicts that do occur.

               

              I found the JBoss JNDI management console extremely helpful in debugging this problem. On my 7.1.1-Final server, this is located at the URL http://myserver.com:9990/console/App.html#naming . I did have to make a JBoss admin user to login to this console. The first time you load that URL, it should give you the directions on how to create a JBoss admin user. (Hint: $JBOSS_HOME/bin/add-user.sh or .bat script.) I also found it helpful to move my web.xml and jboss-web.xml completely out of my .war file, and experiment with changes to only my -ds.xml file.

               

              As usual, a working example is worth a million words. Anyone stumbling on this thread later might want to check out the the jboss7-exampleds.zip file attached to one of my comments in this previous discussion - https://community.jboss.org/thread/199990 . This example does not use the JNDI names discussed above, but hopefully it still makes the relationships between the various parts of the various .xml files clear.