8 Replies Latest reply: Nov 2, 2011 6:37 AM by user3269289 RSS

    OEPE seems to ignore transitive dependencies of JEE modules

    user3269289
      When building JEE projects with Maven (M2E), OEPE seems to ignore transitive dependencies of EAR modules.
      (Before you say that OEPE doesn't support M2E) I suspect that this problem is not specific to M2E, but to the way project is packaged. If I export EAR from this example with native eclipse export facility, it's contents are OK.
      EAR
      `-- RAR (connector project)
        |-- RAR-API (included jar)
        `-- RAR-Impl (included jar)
      When this EAR is prepared for deployment as exploded archive, it's 'beadep' folder contains EAR and RAR folders, transitive dependencies of RAR-API and RAR-Impl, but not RAR-API and RAR-Impl themselves. It stays like that as long API and Impl are resolved as workspace projects (i.e. they are displayed as projects in "Maven Dependencies" library in RAR's build path). If workspace resolution is disabled, these projects turn into ordinary jars and everything starts working as expected. One drawback of this workaround is that I have to continuously update jars in local maven repository for deployed project to be in sync with it's workspace twin.

      Is it possible for OEPE to handle this case gracefully somehow? Or maybe issue a warning that said projects will not be deployed and it can result in CNFE/CDNFE at runtime?

      P.S. Sorry for the noise if this issue is still about M2E-OEPE interaction only. However my experiments show that non-maven connector project with described structure is handled the same way. It is possible that I misconfigured it though :)

      Vadim.

      Edited by: user3269289 on Aug 6, 2011 1:23 PM
        • 1. Re: OEPE seems to ignore transitive dependencies of JEE modules
          danny.ju
          Thanks for bringing this issue up. Can you post the content of .settings\org.eclipse.wst.common.component of the connector project ?
          • 2. Re: OEPE seems to ignore transitive dependencies of JEE modules
            user3269289
            ru.bpc.iso8583jca stays for RAR. Please note that this is components for m2e managed project.
            <project-modules id="moduleCoreId" project-version="1.5.0">
                <wb-module deploy-name="ru.bpc.iso8583jca">
                    <wb-resource deploy-path="/" source-path="/src/main/resources"/>
                    <wb-resource deploy-path="/" source-path="/src/main/java"/>
                    <wb-resource deploy-path="/" source-path="/connectorModule"/>
                    <wb-resource deploy-path="/" source-path="/src/main/rar"/>
                    <dependent-module archiveName="iso8583jca-impl-0.0.1-SNAPSHOT.jar" deploy-path="/" handle="module:/resource/ru.bpc.jca.iso8583.iso8583jca-impl/ru.bpc.jca.iso8583.iso8583jca-impl">
                        <dependency-type>uses</dependency-type>
                    </dependent-module>
                    <dependent-module archiveName="iso8583jca-api-0.0.1-SNAPSHOT.jar" deploy-path="/" handle="module:/resource/ru.bpc.jca.iso8583.iso8583jca-api/ru.bpc.jca.iso8583.iso8583jca-api">
                        <dependency-type>uses</dependency-type>
                    </dependent-module>
                    <dependent-module deploy-path="/" handle="module:/classpath/var/M2_REPO/ru/bpc/iso8583/0.0.4/iso8583-0.0.4.jar">
                        <dependency-type>uses</dependency-type>
                    </dependent-module>
                    <dependent-module deploy-path="/" handle="module:/classpath/var/M2_REPO/commons-lang/commons-lang/2.4/commons-lang-2.4.jar">
                        <dependency-type>uses</dependency-type>
                    </dependent-module>
                    <dependent-module deploy-path="/" handle="module:/classpath/var/M2_REPO/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1.jar">
                        <dependency-type>uses</dependency-type>
                    </dependent-module>
                    <dependent-module deploy-path="/" handle="module:/classpath/var/M2_REPO/commons-io/commons-io/2.0.1/commons-io-2.0.1.jar">
                        <dependency-type>uses</dependency-type>
                    </dependent-module>
                    <property name="java-output-path" value="/ru.bpc.jca.iso8583.iso8583jca-rar/target/classes"/>
                </wb-module>
            </project-modules>
            • 3. Re: OEPE seems to ignore transitive dependencies of JEE modules
              danny.ju
              That seems to be a bug in OEPE. We will fix it in next release. As a workaround, you can change the JavaEE module dependency of the RAR project by
              moving the ru.bpc.jca.iso8583.iso8583jca-api and ru.bpc.jca.iso8583.iso8583jca-impl to the EAR:
              - remove the two project from Deployment Assembly of the RAR project
              - Add them to the EAR project, deploy path will be EarRoot/*.jar

              This results a slightly different classloader hierarchy when your application is deployed to WLS but should solve the issue where the JARs are missing at runtime.
              • 4. Re: OEPE seems to ignore transitive dependencies of JEE modules
                user3269289
                Thanks!

                Just a side note: similar problem can be reproduced with web modules if one of WEB-INF/lib archives is a project in workspace. If these problems can be of a different origin, I can file a new "thread" to track the second one :)

                P.S. BTW, are there any official OEPE bugtracking service?
                • 5. Re: OEPE seems to ignore transitive dependencies of JEE modules
                  danny.ju
                  Can you provide more detail of the proble4m with one of WEB-INF/lib archives is a project in workspace? Please include the .component file.

                  OEPE does not have external bug tracking system but we do monitor this forum closely and create bugs in our internal bug DB.
                  • 6. Re: OEPE seems to ignore transitive dependencies of JEE modules
                    user3269289
                    Sorry for the late reply. If ru.bpc.iso8583 library is a workspace project it isn't included into deployed war.
                    <project-modules id="moduleCoreId" project-version="1.5.0">
                        <wb-module deploy-name="ru.bpc.ktj.agkr">
                            <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
                            <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
                            <wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated/cxf"/>
                            <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
                            <wb-resource deploy-path="/" source-path="/src/main/webapp"/>
                            <dependent-module archiveName="iso8583-0.0.5-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/ru.bpc.iso8583/ru.bpc.iso8583">
                                <dependency-type>uses</dependency-type>
                            </dependent-module>
                            <property name="java-output-path" value="/ru.bpc.ktj.agkr.war/target/classes"/>
                            <property name="context-root" value="war"/>
                        </wb-module>
                    </project-modules>
                    • 7. Re: OEPE seems to ignore transitive dependencies of JEE modules
                      user3269289
                      Hello.

                      11.1.1.8 seems to have the second case fixed, but the first is still missing some jar's. Was the first one fixed? If so, I will look into my eclipse installation (last update run a little roughly).

                      Thanks.
                      • 8. Re: OEPE seems to ignore transitive dependencies of JEE modules
                        user3269289
                        Reimported all projects, cleaned WL deployments and everything started to work as expected.
                        Many thanks, this issue was a real pain :)