我刚刚将所有 java.util.logging 代码迁移到我的 GAE/J 应用程序中的 log4j 但是我收到了这个错误:
[INFO] Caused by: java.lang.NoClassDefFoundError: java.lang.management.ManagementFactory is a restricted class. Please see the Google App Engine developer's guide for more details.
[INFO] at com.google.appengine.tools.development.agent.runtime.Runtime.reject(Runtime.java:51)
[INFO] at org.apache.logging.log4j.core.appender.rolling.OnStartupTriggeringPolicy.<clinit>(OnStartupTriggeringPolicy.java:33)
[INFO] at java.lang.Class.forName0(Native Method)
[INFO] at java.lang.Class.forName(Class.java:186)
[INFO] at org.apache.logging.log4j.core.config.plugins.PluginManager.decode(PluginManager.java:222
有解决办法吗?
Log4j 的依赖是通过:
<dependency>
<groupId>org.apache.onami.logging</groupId>
<artifactId>org.apache.onami.logging.log4j2</artifactId>
<version>3.4.0-incubating</version>
</dependency>