Problem:
- Product Name: Borland Enterprise Server
- Product Version: 6.0.x, 6.5
- Product Component: Partition
- Platform/OS Version: All
When deploying EAR file which contains a log4j.jar and custom developed jar which contains custom log4j Appenders/Layouts , the BES classloader hierarchy seems to load the log4j.jar from the system classpath and not from the EAR (thus rendering the custom Appenders/Layouts invisible to the log4j infrastructure). Is there any mechanism via which we could either tell the EJB Container to use the log4j.jar loaded by the EAR, or via which we can remove the log4j.jar from the BES system classpath?
Resolution:
The default behavior of BES"s application classloader is that it will prefer classes in its own archives before classes in their parent (partition and system classes). However, application classloader delegate to their parent for the following packages defined by "system.classload.prefixes" in partition.xml.
In order to let your own application module (.war, .ear, .jar) to work "as is" within BES server, you need to take out necessary package from "system.classload.prefixes" in partition.xml. In this particular example, your application bundle with log4j.jar and custom log4j Appenders/Layouts, hence, you need to take out package "org.apache.log4j" from "system.classload.prefixes".
The file partition.xml can be located under the folder \\var\\domains\\base\\configurations\\\\mos\\\\adm\\properties
#Security
#VisiBroker