10 Replies Latest reply on Dec 4, 2012 1:39 PM by numerico

    CLI deployment archive problem

    thohawk

      Hi,

       

      First of all, the new CLI deployment archive feature of 7.2.x solves a lot of problems for my migration from 5.1! I have 20+ standalone servers that now can be configured at deploy-time. Thanks!

       

      Playing with the latest nightly build from yesterday, my CLI archive consists of the following;

       

      - mywebapp.war

      - postgresql-9.1-902.jdbc4.jar

      - deploy.scr

      - undeploy.scr

       

      deploy.scr has the following lines;

       

      deploy postgresql-9.1-902.jdbc4.jar

      data-source add --name=MyDS --jndi-name=java:jboss/datasources/MyDS --driver-name=postgresql-9.1-902.jdbc4.jar --connection-url=[not important for this example]

      deploy mywebapp.war

       

      That is, install my jdbc driver, create the data-source, and finally deploy my webapp which uses the data-source. This does not work :-( The error is;

       

      [standalone@localhost:9999 /] deploy mycliarchive.cli

      ......

      Failed to execute archive script: {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => "JBAS010468: Driver named \"postgresql-9.1-902.jdbc4.jar\" is not installed."}}

       

      What works is;

       

      ./jboss-cli.sh -c --file=deploy.scr

       

      What is the difference?

        • 1. Re: CLI deployment archive problem
          aloubyansky

          The difference is that the script in the archive is executed as a single composite operation. So, looks like the driver is not yet available when the datasource is added.

           

          The --file argument executes commands separately, i.e. one after another.

           

          Thanks for bringing this up, that's an issue.

          • 2. Re: CLI deployment archive problem
            thohawk

            Hi Alexey,

             

            Should i watch a JBAS-XXXX issue for updates on this problem? Would it help if i try to provide a test-case on this issue?

            • 3. Re: CLI deployment archive problem
              aloubyansky

              There is no specific jira issue for this yet. We are looking into where and how it should be fixed. I'll post here later. Thanks.

              • 4. Re: CLI deployment archive problem
                aloubyansky
                • 5. Re: CLI deployment archive problem
                  thohawk

                  The jira issue is marked as resolved; Using todays nightly build, i now get;

                   

                  #1 deploy --force postgresql-9.1-902.jdbc4.jar

                  #2 data-source add --name=MyDS --jndi-name=java:jboss/datasources/MyDS --driver-name=postgresql-9.1-902.jdbc4.jar --connection-url=[....]

                  Failed to execute archive script: {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.driver-demander.java:jboss/datasources/MyDS Missing[jboss.jdbc-driver.postgresql-9_1-902_jdbc4_jar]"]}}}

                   

                  could i be doing something wrong or is the entire fix not yet in the nightly build?

                  • 6. Re: CLI deployment archive problem
                    numerico

                    I'm getting the exact same error, what was the resolution then? I tested against the nightly build and the github repo...

                     

                    Besides, when you say ./jboss-cli.sh -c --file=deploy.scr does work, do you have to copy the components separately into the server?
                    I'm getting

                    Path /home/me/JAVA/jboss-as-7.2.0.Alpha1-SNAPSHOT/bin/jtds-1.2.6.jar doesn't exist.
                    • 7. Re: CLI deployment archive problem
                      thohawk

                      The "solution" was to manually copy my jdbc driver to the deploy directory, and not have inside the .war-file. Then you can reference it in your deploy.scr (in your .war-file).

                       

                      If you run the depoy.scr directly from within the bin directory, the file "jtds-1.2.6.jar" must be in that directory.

                      • 8. Re: CLI deployment archive problem
                        numerico

                        Thanks for the quick reply!


                        I think my issue might be more related to the archive being processed as a single operation than with the jdbc driver itself, which, apparently, does deploy ok (I'm using today's sources from GitHub). I opened a new issue for my specific problem, if you're interested >>

                         

                        Anyway, isn't deploying the driver separetly against the whole spirit of a CLI deployment archive, that is to unify application configuration?

                         

                        Greetings

                        • 9. Re: CLI deployment archive problem
                          thohawk

                          Hi Soto,

                           

                          Great to hear that you opened an issue, but isn't https://issues.jboss.org/browse/AS7-5616 about that?

                          • 10. Re: CLI deployment archive problem
                            numerico

                            I didn't really mean an issue but a forum thread, sorry...

                             

                            Anyway, if you read through it you'll see it could be different - though related - since the datasource in the deployment archive did work for me but not the resource adapter, so I think I could be kind of the same issue lacking resoultion for RARs too

                             

                            greetings