It is better if you have log4j.jar file under WEB-INF\lib
directory. Then, it can be used by both web application and ejb application code base. To do this, make sure in your ejb jar file you have META-INF/MANIFEST.MF
file specify the log4j jar file path under Class-Path
entry. Bear in mind, the path has to be relative to your ejb jar file.
For example, in the structure below you can specify in the Class-Path
entry of MANIFEST.MF as lib/log4j.jar
WAR
|
-- WEB-INF
|
-- web.xml
|
-- classes
|
-- lib
|
-- ejb jar
| |
| |-- META-INF
| |
| -- MANIFEST.MF
|
|
|
|-- log4j.jar
(formatting is not that great as it is hand-typed)