I intend to create a common jar which contains all
Java Classes related to implementing log4j logging functionality.I have implemented Singleton (GoF) design
pattern in a class SLogger to return single instance of log4j across the application.
I have created customlogger.jar file with all class files related to log4j logging and lib folder containing log4j-1.2.8.jar file.
Following shows the directory structure :
-customlogger
----src/
------com.vilpesh.logger
----lib/
------log4j-1.2.8
----META-INF
------MANIFEST.MF
Contents of MANIFEST.MF is
Manifest-Version: 1.0
Class-Path: lib/log4j-1.2.8.jar
When i add the customlogger.java in my other application and try to make use of logging functionality i get following error
java.lang.NoClassDefFoundError: org.apache.log4j.PropertyConfigurator My other application is deployed in a Websphere application server 6.1.
In the Class SLogger, i have a code statement,which raises error
PropertyConfigurator.configure("C://log4j.properties");
Is it possible to refer to log4j.jar from customlogger.jar?
I want to make any application in the world to be making use of customlogger.jar.
I think the
J2EE application server can load the customlogger.jar but it cannot somehow load log4j.jar