Class org.apache.commons.logging.impl.Jdk14Logger does not implement Log

Bomin picture Bomin · Oct 13, 2013 · Viewed 7.2k times · Source

I'm hitting the same problem described in here, but I don't know my websphere version at the time

More questions 1) does Removing commons-logging-1.1.jar fix it? 2) what if I really need to put commons-logging-1.1.jar in my application? How can I fix this?

Answer

Isaac picture Isaac · May 22, 2014

This happens because the class org.apache.commons.logging.impl.Jdk14Logger is loaded by a different classloader than the one that loaded the Log interface.

According to IBM's documentation, whenever you use a third-party library that WebSphere itself uses for its own internal purposes, you must:

  1. Set your EAR's classloader policy to PARENT_LAST; and
  2. Ensure that your EAR is self-sufficient. That is, that your third-party libraries (and their dependencies) are bundled within the EAR.

In your case:

  1. Set your EAR's classloader policy to PARENT_LAST
  2. Include commons-logging-1.1.jar within your EAR (you can place it in the "EAR Library" directory, usually EAR/lib).