多个classloader加载log4j时需要设置当前Thread的classloader为你自己的classloader Thread.currentThread().setContextClassLoader(classLoader); //for log4j 摘自:org.apache.log4j.helpers.Loader /** * If running under JDK 1.2 load the specified class using the * <code>Thread&…