Topic
  • 4 replies
  • Latest Post - ‏2013-01-03T16:52:03Z by charuseela
charuseela
charuseela
9 Posts

Pinned topic Deployment Assembly

‏2013-01-03T02:56:58Z |
Is there an order of precedence among the deployment assembly entries of a web project if the same named resource is in more than one location?

https://www.ibm.com/developerworks/wikis/download/attachments/140051369/Java+EE+Deployment+Assembly_801.pdf?version=1

Which one will be picked when we export the war?
Updated on 2013-01-03T16:52:03Z at 2013-01-03T16:52:03Z by charuseela
  • Chuck_Bridgham
    Chuck_Bridgham
    7 Posts

    Re: Deployment Assembly

    ‏2013-01-03T15:08:54Z  
    They are copied in the order they appear in the list. If two source folders mapped to the same location have a similar named file, the last folder copied will set the contents.

    Thanks - Chuck
  • charuseela
    charuseela
    9 Posts

    Re: Deployment Assembly

    ‏2013-01-03T15:33:26Z  
    They are copied in the order they appear in the list. If two source folders mapped to the same location have a similar named file, the last folder copied will set the contents.

    Thanks - Chuck
    As the eclipse GUI does not have a way to order Deployment Assemblies, I tried manually modifying the org.eclipse.wst.common.component

    <?xml version="1.0" encoding="UTF-8"?>
    <project-modules id="moduleCoreId" project-version="1.5.0">
    <wb-module deploy-name="webServices">
    <wb-resource deploy-path="/" source-path="/.ws/weboutput"/>
    <wb-resource deploy-path="/" source-path="/WebContent" tag="defaultRootSource"/>
    <wb-resource deploy-path="/WEB-INF/classes" source-path="/src"/>
    <property name="context-root" value="webServices"/>
    <property name="java-output-path" value="/webServices/build/classes"/>
    </wb-module>
    </project-modules>

    If the web.xml is in both /.ws/weboutput/WEB-INF and /WebContent/WEB-INF, which one will be picked?
    What about same named classes in /.ws/weboutput/WEB-INF/classes and /WebContent/WEB-INF/classes?
    What is the significance of the tag "defaultRootSource"?

    Another thing I am noticing is that the "Web App Libraries" container is picking up different things depending on the order.
  • Chuck_Bridgham
    Chuck_Bridgham
    7 Posts

    Re: Deployment Assembly

    ‏2013-01-03T16:15:58Z  
    As the eclipse GUI does not have a way to order Deployment Assemblies, I tried manually modifying the org.eclipse.wst.common.component

    <?xml version="1.0" encoding="UTF-8"?>
    <project-modules id="moduleCoreId" project-version="1.5.0">
    <wb-module deploy-name="webServices">
    <wb-resource deploy-path="/" source-path="/.ws/weboutput"/>
    <wb-resource deploy-path="/" source-path="/WebContent" tag="defaultRootSource"/>
    <wb-resource deploy-path="/WEB-INF/classes" source-path="/src"/>
    <property name="context-root" value="webServices"/>
    <property name="java-output-path" value="/webServices/build/classes"/>
    </wb-module>
    </project-modules>

    If the web.xml is in both /.ws/weboutput/WEB-INF and /WebContent/WEB-INF, which one will be picked?
    What about same named classes in /.ws/weboutput/WEB-INF/classes and /WebContent/WEB-INF/classes?
    What is the significance of the tag "defaultRootSource"?

    Another thing I am noticing is that the "Web App Libraries" container is picking up different things depending on the order.
    The tag "defaultRootSource" is used to determine which source folder contains the deployment descriptor that RAD will load and reflect in the tools.
    The order in this file sets the precedence in which they are copied. No magic here.

    So sounds like you have some JAX-WS generation that you want merged into the archive? In RAD, are these class files in a classes folder? It may be the archive is created correctly, but in RAD - the java tools are not reading the generated java classes.

    Web App libraries container keeps track of any libraries in WEB-INF/lib. The src/output folders shouldn't affect the contents here, but will change the overall classpath of the war project.
  • charuseela
    charuseela
    9 Posts

    Re: Deployment Assembly

    ‏2013-01-03T16:52:03Z  
    The tag "defaultRootSource" is used to determine which source folder contains the deployment descriptor that RAD will load and reflect in the tools.
    The order in this file sets the precedence in which they are copied. No magic here.

    So sounds like you have some JAX-WS generation that you want merged into the archive? In RAD, are these class files in a classes folder? It may be the archive is created correctly, but in RAD - the java tools are not reading the generated java classes.

    Web App libraries container keeps track of any libraries in WEB-INF/lib. The src/output folders shouldn't affect the contents here, but will change the overall classpath of the war project.
    I am asking the question in context of pure eclipse EE. I have a custom ant builder for jax-rpc which generates deployment descriptors etc. in the /.ws/weboutput/WEB_INF folder based on the ones in WebContent/WEB-INF and I want the ones in /.ws/weboutput/WEB_INF take precedence when the war is generated.

    Web App Libraries container is actually showing up classes that were generated under /.ws/weboutput/WEB-INF/classes (my /WebContent/WEB-INF/classes and lib are empty though)