How to set the order of jars in Weblogic EAR?
I have an EAR file that contains two different jars that share some classes with the same package + class name. This makes it important to load classes within the EAR file itself.
How can I tell Weblogic to load one jar from APP-INF / lib before loading another to the same APP-INF / lib? I need to define a specific order for this, if there is a conflict, it will take from JAR a, not JAR b.
I am using Webogic 11g (10.3).
Thank.
source to share
The top-level element in weblogic-application.xml
has an optional member of the loadload class structure, which you probably want to look into. For example, you can do something like:
<classloader-structure>
<module-ref>
<module-uri>ejb1.jar</module-uri>
</module-ref>
<module-ref>
<module-uri>web3.war</module-uri>
</module-ref>
<classloader-structure>
<module-ref>
<module-uri>web1.war</module-uri>
</module-ref>
</classloader-structure>
</classloader-structure>
Learn more about declaring a custom class to load in the Oracle docs . You can also find the Class Loader Analysis Tool (CAT) in the same link.
source to share