4 Replies Latest reply on Sep 30, 2010 12:14 PM by Aleksander Adamowski

    specifying deployment dependencies of BPEL jars on an EAR?

    Aleksander Adamowski Newbie

      Hi!

       

      Is there a way (using a XML file in JAR's META-INF/, perhaps) to specify that a given BPEL jar deployment depends on some other deployment unit (an EAR, in my case)?

       

      Similarly to the jboss-dependency.xml file described here:  http://community.jboss.org/wiki/JBoss5custommetadatafiles ?

        • 1. Re: specifying deployment dependencies of BPEL jars on an EAR?
          Gary Brown Master

          The jboss-dependency.xml is probably the best approach to achieve this. Have you actually tried this, to see if it met your needs?

           

          Regards

          Gary

          • 2. Re: specifying deployment dependencies of BPEL jars on an EAR?
            Aleksander Adamowski Newbie

            I'm still looking for docs on how to specify an EAR deployment unit as a dependency, the article on the wiki is very thin on details and there seems to be no official documentation on this descriptor yet.

             

            If you have any working examples on how to specify an EAR in jboss-dependency.xml, I'd appreciate that (and probably numerous other future users).

            • 3. Re: specifying deployment dependencies of BPEL jars on an EAR?
              Gary Brown Master

              I agree, haven't found much documentation. You could try what is suggested in here: http://java.dzone.com/articles/jboss-microcontainer-virtual-deployment-framework

               

              Search for 'jboss-dependency.xml' in section "Hidden Gems", in the XML snippet the second style uses an alias:

               

              <dependency xmlns="urn:jboss:dependency:1.0">

                <item whenRequired="Real" dependentState="Create">TransactionManager</item> (1)
                <item>my-human-readable-deployment-alias</item> (2)
              </dependency>

               

              Then in the text it says:

               

              Item (2) looks a bit more confusing, since we're missing additional information. By default deployment names inside MC are 'ugly' URI names, which makes typing them by hand an error prone proposition.


              So, in order to still be able to easily declare dependency on other deployments, we need an aliasing mechanism to avoid this 'ugly' URI names. Making this as simple as possible, simply drop plain txt file named aliases.txt into your deployment, where each line contains a new alias, thereby giving a deployment archive one or more simple names used to refer to it.

               

              Its possible that the name of the archive could be used instead of an alias -  might be worth trying both options.

               

              Hope that helps.

               

              Regards

              Gary

              • 4. Re: specifying deployment dependencies of BPEL jars on an EAR?
                Aleksander Adamowski Newbie

                OK, thanks for suggestion.

                 

                I've tried it and it works. I needed to figure out some things by myself, because of the vapourmentation. So here are some things I've learned:

                 

                • both jboss-dependency.xml and aliases.txt must be placed in respective archives' META-INF subdirectory
                • there are still some exceptions logged during application server startup because initially JAR's are deployed according to the standard order (JARs first, then EAR) and container complains "Deployment "blahblah.jar/" is missing the following dependencies: .... NOT FOUND Depends on 'MyApplicationAlias'".
                  However, once the EAR is deployed and its alias identified, immediately after EAR deployment completes JBoss notices that the dependency can now be satisfied and retries deployment of JARs - this time with success.

                 

                 

                The aliases.txt file's location is: JBOSS_CONFIGURATION_DIR/farm/my-application.ear!META-INF/aliases.txt and the contents looks like this:

                 

                MyApplicationAlias

                 

                 

                The  jboss-dependency.xml file's location is: JBOSS_CONFIGURATION_DIR/farm/my-bpel-process.jar!META-INF/jboss-dependency.xml and the contents look like this:

                 

                <dependency xmlns="urn:jboss:dependency:1.0">
                  <item whenRequired="Real" dependentState="Create">WdxIntegration</item>
                  <item>WDX integration EAR dependency. The EAR must have the alias name "WdxIntegration" specified
                    in its aliases.txt file.</item>
                </dependency>
                <dependency xmlns="urn:jboss:dependency:1.0">
                  <item whenRequired="Real" dependentState="Create">MyApplicationAlias</item>
                  <item>My application EAR dependency. The EAR must have the alias name "MyApplicationAlias" specified
                    in its aliases.txt file.</item>
                </dependency>