我正在尝试运行我创建的Java 9模块,它使用Log4j2 2.10.0.
我遇到的问题是我得到了一个
java.lang.NoClassDefFoundError: Could not initialize class org.apache.logging.log4j.util.PropertiesUtil
Run Code Online (Sandbox Code Playgroud)
做的时候LogManager.getLogger().它发现LogManager类很好,但是当它new PropertiesUtil("log4j2.StatusLogger.properties")从内部进入调用时StatusLogger,它会得到上面的错误.
如何修复/找到解决方法?
添加信息:
堆栈跟踪:
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.apache.logging.log4j.util.PropertiesUtil
at org.apache.logging.log4j/org.apache.logging.log4j.status.StatusLogger.<clinit>(StatusLogger.java:71)
at org.apache.logging.log4j/org.apache.logging.log4j.LogManager.<clinit>(LogManager.java:60)
at com.EvolutionarySoftwareSystems.Utilities/com.EvolutionarySoftwareSystems.Utilities.Base.DebugAble.<clinit>(DebugAble.java:45)
Run Code Online (Sandbox Code Playgroud)
更奇怪的是我可以直接调用invoke:new PropertiesUtil("string")从我的代码中找到类.
我正在使用日食氧气4.7.1a.
我的eclipse启动配置文件:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<setAttribute key="name.schedenig.eclipse.grepconsole.DisabledIds"/>
<setAttribute key="name.schedenig.eclipse.grepconsole.EnabledIds"/>
<setAttribute key="name.schedenig.eclipse.grepconsole.FilterDisabledIds"/>
<setAttribute key="name.schedenig.eclipse.grepconsole.FilterEnabledIds"/>
<setAttribute key="name.schedenig.eclipse.grepconsole.StatisticsDisabledIds"/>
<setAttribute key="name.schedenig.eclipse.grepconsole.StatisticsEnabledIds"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/Evolver/src/com/EvolutionarySoftwareSystems/Evolver/Server/EvolServer.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"/>
<stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <sourceLookupDirector> <sourceContainers …Run Code Online (Sandbox Code Playgroud)