Search code examples
javajbossmigrationejbweblogic

JBoss EAP 6 cannot find JARs in APP-INF/lib


I am doing a migration from Weblogic to JBoss EAP 6.4 but I am having a problem deploying to and starting the JBoss server.

My EAR structure is as follows:

.EAR
|
|---APP-INF
|      |---lib
|           |---[many .jar files]
|
|---META-INF
|       |---application.xml
|       |---jboss-deployment-structure.xml
|
|---[EJB JAR files]

The problem:

The EJB JARs in the root of the EAR cannot access the classes in the JARs that are in the APP-INF/lib folder.


Solution

  • I manually put the lib folder at the root of the EAR instead of in the APP-INF folder and it seemed to do the trick.

    JBoss was looking inside .EAR/lib instead of .EAR/APP-INF/lib

    Then, I added the following in the maven-ear-plugin section in my pom.xml to get maven to create the lib folder at the root and not in APP-INF:

    <plugin>
        <artifactId>maven-ear-plugin</artifactId>
        <version>2.9.1</version>
        <configuration>
            <defaultLibBundleDir>lib</defaultLibBundleDir>
            <goals>
                <goal>generate-application-xml</goal>
                <initializeInOrder>true</initializeInOrder>
            </goals>
        </configuration>
    </plugin>