4 Replies Latest reply on Nov 29, 2009 5:08 PM by rareddy

    Single Deployment Unit from multiple files inside a zip

    rareddy

      Hi,

      I am trying to write a new deployer for Teiid artifact which is a zip file. In there I have two xml files that I need to parse and gather metadata and deploy them as single unit.

      To accomplish this, I wrote deployer that extends "MultipleVFSParsingDeployer" and defined mappings and the "parse" and "merge" calls are being called correctly on the XML files, however the DeploymentUnit supplied in each individual parse call is file itself rather than the parent zip file, thus I am ending up with two deployments at the end rather than one. Can you please help me how I can configure them to work under single deployment unit.

      I also tried individual deployer for each of my XML file extending "AbstractVFSParsingDeployer" but the behaviour is same.

      For example:

      Foo.zip
      - a.xml
      - b.xml

      while parsing "a.xml" and "b.xml" I would like "Foo.zip" as DeploymentUnit, instead of "Foo.zip#a.xml"

      Thank you.

      Ramesh..

        • 1. Re: Single Deployment Unit from multiple files inside a zip
          rareddy

          I am not sure how the "StructureDeployer" works, however once I created a structure for my version of the ZIP file, it works as I expected. The deployer invokes once for "a.xml" and once for "b.xml" then invokes merge for the "zip" metadata iteself with metadata from a.xml and b.xml files.

          • 2. Re: Single Deployment Unit from multiple files inside a zip
            emuckenhuber

             

            "rareddy" wrote:
            I am not sure how the "StructureDeployer" works, however once I created a structure for my version of the ZIP file, it works as I expected. The deployer invokes once for "a.xml" and once for "b.xml" then invokes merge for the "zip" metadata iteself with metadata from a.xml and b.xml files.


            The StructureDeployers determine classpath and metadata locations of a deployment mostly independent of the file extension. The problem with providing a StructureDeployer for ".zip" files is that you modify the behavior for all ".zip" files, which shouldn't be done.

            Therefore i'd rather suggest that you move your deployment descriptors to the "META-INF" folder, which is the standard metadata location or maybe provide your own extension.

            • 3. Re: Single Deployment Unit from multiple files inside a zip
              alesj

              Like Emanuel suggests, metadata/config files normally go to META-INF
              (or WEB-INF in case of .war deployments).

              If that doesn't suite you, instead of your own StructureDeployer,
              you can simply declare your custom structure via jboss-structure.xml:
              * http://www.jboss.org/community/docs/DOC-13178

              • 4. Re: Single Deployment Unit from multiple files inside a zip
                rareddy

                Actually, the extension I am using is ".vdb", which is zip file underneath, so I would not be altering the original behaviour. I do like Ales's suggestion of using the "jboss-structure.xml" file, I will try to use that.

                Thank you for the replies.