3 Replies Latest reply on Sep 4, 2012 1:18 PM by bonomini

    EAR jars dependency

    bonomini

      Hello,

       

       

      I have a huge app, many jars are inside of the EAR's folder, at the root I mean.

      So, I'm getting a lot of missing dependencies errors.

      The question is: How do I make those jars see each others, and how do I make WAR's jars see those on EAR root?

       

      I have over 100 jars and canno't deploy my app, is there a way to turn deployment.earname a global module, that could be found by ANY WAR/JAR?

       

      Here is part of the LOG:

       

      service jboss.module.service."deployment.MyApp-ByYou-11.8-SNAPSHOT.ear.MyApp-framework-hub-java-11.8.0-SNAPSHOT.jar".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.MyApp-ByYou-11.8-SNAPSHOT.ear.MyApp-framework-hub-java-11.8.0-SNAPSHOT.jar".main: JBAS018759: Failed to load module: deployment.MyApp-ByYou-11.8-SNAPSHOT.ear.MyApp-framework-hub-java-11.8.0-SNAPSHOT.jar:main

      service jboss.module.service."deployment.MyApp-ByYou-11.8-SNAPSHOT.ear.MyApp-framework-ecmpublisher-java-11.8.0-SNAPSHOT.jar".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.MyApp-ByYou-11.8-SNAPSHOT.ear.MyApp-framework-ecmpublisher-java-11.8.0-SNAPSHOT.jar".main: JBAS018759: Failed to load module: deployment.MyApp-ByYou-11.8-SNAPSHOT.ear.MyApp-framework-ecmpublisher-java-11.8.0-SNAPSHOT.jar:main

      service jboss.module.service."deployment.MyApp-ByYou-11.8-SNAPSHOT.ear.MyApp-framework-documentscentral-ws-java-11.8.0-SNAPSHOT.jar".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.MyApp-ByYou-11.8-SNAPSHOT.ear.MyApp-framework-documentscentral-ws-java-11.8.0-SNAPSHOT.jar".main: JBAS018759: Failed to load module: deployment.MyApp-ByYou-11.8-SNAPSHOT.ear.MyApp-framework-documentscentral-ws-java-11.8.0-SNAPSHOT.jar:main

      service jboss.module.service."deployment.MyApp-ByYou-11.8-SNAPSHOT.ear.MyApp-specific-war-11.8.0-SNAPSHOT.war".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.MyApp-ByYou-11.8-SNAPSHOT.ear.MyApp-specific-war-11.8.0-SNAPSHOT.war".main: JBAS018759: Failed to load module: deployment.MyApp-ByYou-11.8-SNAPSHOT.ear.MyApp-specific-war-11.8.0-SNAPSHOT.war:main

       

       

      Thanks in advance.

        • 1. Re: EAR jars dependency
          swd847

          Is there any reason why you can't put those jars into ear/lib ?

           

          This will make them availble to the whole application. Non ejb-jars (i.e. jars without EJB component defiining annotations or listed as an ejb-jar in application.xml) in the root of the appplication will not be deployed by default (this is per the EE6 platform spec), if you want to leave them where they are you must list them as Class-Path entries in the manifest of any class that wants to use them, which sounds impractical for your case.

          • 2. Re: EAR jars dependency
            sfcoy

            It's easy enough to get maven to generate manifest classpath entries:

             

            {code:xml}            <plugin>

                            <artifactId>maven-jar-plugin</artifactId>

                            <configuration>

                                <archive>

                                    <manifest>

                                        <addClasspath>true</addClasspath>

                                    </manifest>

                                </archive>

                            </configuration>

                        </plugin>{code}

             

            but I agree with Stuart. Moving library jars to the EAR/lib directory is much more manageable.

             

            Also, the current maven-ear-plugin is pretty good at assembling correct EAR files this way too:

             

            {code:xml}           <plugin>

                            <artifactId>maven-ear-plugin</artifactId>

                            <configuration>

                                <version>6</version>

                                <generateApplicationXml>true</generateApplicationXml>

                                <defaultLibBundleDir>lib</defaultLibBundleDir>

                                <skinnyWars>true</skinnyWars>

                                <modules>

                                    <webModule>

                                        <groupId>${project.groupId}</groupId>

                                        <artifactId>...</artifactId>

                                        <contextRoot>...</contextRoot>

                                    </webModule>

                                    <webModule>

                                        <groupId>${project.groupId}</groupId>

                                        ...

                                    </webModule>

                                    <ejbModule>

                                        <groupId>${project.groupId}</groupId>

                                        <artifactId>...</artifactId>

                                    </ejbModule>

                                </modules>

                            </configuration>

                        </plugin>{code}

            1 of 1 people found this helpful
            • 3. Re: EAR jars dependency
              bonomini

              Thanks Very much! I'm migrating from 4.2.3 so I didn't this.

               

               

               

              I'll stay with ur answer and take the helpful one as knowledge and maybe use in the future!

               

               

               

               

              See ya.