1 Reply Latest reply on Aug 11, 2014 11:26 AM by André Simões

    Wildfly migration inter jar files dependencies issue

    André Simões Newbie

      Hi.

      I am migrating a project from jboss 5 to wildfly 8.1.

       

      Our project has a lot of jar and some war files

      On this project  I  use maven for dependency resolution.

       

      So I am rewriting  pom files and trying to deploy on wildfly some jars.

      I  managed to install third party dependencies as modules (note sure if the right approach). On Jboss 5 this dependencies were one common/lib

       

      I am compiling the source code and deploying manually on standalone/deployments folder.

      Now I am facing a problem.

       

      Let say I deploy A.jar

      Now, B.jar depends of A.jar, as some classes are defined there.

      When I deploy B.jar wildfly complains about not finding someClass that I know that are defined on A.jar.

       

      This were a common practice on jboss 5.

      I read something about classloading changes from jboss 5 to wildfly but I really do not see how that impact is this case.

       

      I also downloaded quickstart-master examples and checked inter-app example.

      The example inter-app shows how to do it, but with war packaging: appA.war appB.war and shared.jar.

               

      It is not possible to do it on jar packages? If not, could some one point me to a explanation?

      Could it be another problem as wildfly wrongly points a class not found exception?

      B.jar has EJB and JPA code.

        • 1. Re: Wildfly migration inter jar files dependencies issue
          André Simões Newbie

          Well, i manage to find the answer for my question.

           

          To anyone who has an ejb project that has a dependency that for any reason you do not what to place on global dependencies (modules), but in deploy folder, you can use this:

           

          On the ejb project that need the dependency, you need to declare it (has we do on jboss 5), now the trick is add the following line to the ejb plugin on build

           

          <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-ejb-plugin</artifactId>
              <configuration>
                  <archive>
                      <manifestEntries>
                          <Dependencies>deployment.A.jar</Dependencies>
                      </manifestEntries>
                  </archive>
              </configuration>
          </plugin>
          
          

           

          where A.jar is or "missing" dependency.

           

          Note:  maven-ejb-plugin version is defined on my parent pom as

           

          <build>   
              <pluginManagement>
                  <plugins>
                      <plugin>
                          <!-- must include ejb-plugin to change the EJB version from 2.1 to 3.1 -->
                          <groupId>org.apache.maven.plugins</groupId>
                          <artifactId>maven-ejb-plugin</artifactId>
                          <version>${ejb.plugin.version}</version>
                          <configuration>
                              <ejbVersion>3.1</ejbVersion>
                              <generateClient>false</generateClient>
                              <addClasspath>true</addClasspath>
                              <archive>
                                  <addMavenDescriptor>true</addMavenDescriptor>
                              </archive>
                          </configuration>
                      </plugin>
                  </plugins>
              </pluginManagement>
          </build>
          
          

           

          I am not sure that this is "best practices", so if you see any problem here, please report.

          1 of 1 people found this helpful