In application.xml there can be <library-directory>
element that points to the location to shared libraries within EAR. For example, for directory lib
in the root of EAR there should be entry <library-directory>lib</library-directory>
in application.xml:
<application xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd" version="5">
<module>
<java>module1.jar</java>
</module>
<module>
<web>
<web-uri>module2.war</web-uri>
<context-root>module2</context-root>
</web>
</module>
<library-directory>lib</library-directory>
</application>