I am sorry that I am replying to one of the oldest
thread. Long time back I had found a solution in another forum. Wish I could recall and paste that link.
I have tested the solution provided by them on Websphere 6.1 and websphere 7 and it works.
1) No need to have commons-logging.properties in the classpath. No need to change the class loading policy to PARENT_LAST.
2) Under META-INF/services, create a file by name "org.apache.commons.logging.LogFactory". The content of file should be just "org.apache.commons.logging.impl.Log4jFactory"
3) Now comes the most important part. Websphere 6.1 and 7.0 still uses apache-commons-logging "1.0.3" version.
a) In Websphere 6.1, go to <WEBSPHERE INSTALLED FOLDER>/plugins and open the jar "com.ibm.ws.runtime_6.1.0.jar". It contains the commons logging file
b) Download apache commons logging 1.0.3 version from its archived website. Open the downloaded jar. When you compare the contents with the jar file of Websphere you will find that the downloaded version of apache commons logging has the below extra files
- org.apache.commons.logging.impl.Log4JCategoryLog.class
- org.apache.commons.logging.impl.Log4jFactory.class
- org.apache.commons.logging.impl.Log4JLogger.class
- org.apache.commons.logging.impl.LogKitLogger.class
All other files are common files in both websphere and apache library.
c) Now from the downloaded apache commons logging jar, delete the common files. Only retain the above mentioned file. Once you are done, you will basically have a stripped version of apache commons logging 1.0.3. Put this stripped jar in WEB-INF/lib
d) You are all set, restart the server.
4) In Websphere 7.0, the apache commons logging can be found at <WEBSPHERE INSTALLED FOLDER>/plugins/com.ibm.ws.prereq.commons-logging.jar. All other activities will be similar to the one explained above
5) With this approach, we are not changing core library file of Websphere. Neither we are changing the class loading policies.
As I mentioned above, this solution was found in some forum which I am unable to recall. I have basically tried to provide as much information as I can. I had done the above activities in one of my previous project and was successful.