这个错误似乎很笼统。要获取更多详细信息,请使用以下选项启动 JVM:
-Dorg.apache.commons.logging.diagnostics.dest=STDOUT
就我而言,发现了一些缺少的依赖项。
[LogFactoryImpl@929338653 from sun.misc.Launcher$AppClassLoader@1442407170] Attempting to instantiate 'org.apache.commons.logging.impl.Log4JLogger'
[LogFactoryImpl@929338653 from sun.misc.Launcher$AppClassLoader@1442407170] Trying to load 'org.apache.commons.logging.impl.Log4JLogger' from classloader sun.misc.Launcher$AppClassLoader@1442407170
[LogFactoryImpl@929338653 from sun.misc.Launcher$AppClassLoader@1442407170] Class 'org.apache.commons.logging.impl.Log4JLogger' was found at 'jar:file:/home/mcadiz/NetBeansProjects/LogFilter/dist/lib/commons-logging-1.2.jar!/org/apache/commons/logging/impl/Log4JLogger.class'
[LogFactoryImpl@929338653 from sun.misc.Launcher$AppClassLoader@1442407170] The log adapter 'org.apache.commons.logging.impl.Log4JLogger' is missing dependencies when loaded via classloader sun.misc.Launcher$AppClassLoader@1442407170: org/apache/log4j/Priority
Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: org.apache.commons.logging.LogConfigurationException: User-specified log class 'org.apache.commons.logging.impl.Log4JLogger' cannot be found or is not useable.
at org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:804)
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:541)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:292)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:269)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:655)
at com.oracle.logfilter.LogEntry.<clinit>(LogEntry.java:19)
将 log4j.jar 添加到类路径解决了这个问题。