gpt4 book ai didi

java - Akka 2.5 和 Slf4j 使用 nashorn 抛出 NPE

转载 作者:太空宇宙 更新时间:2023-11-04 11:27:51 25 4
gpt4 key购买 nike

我有一个使用 Akka 2.5 和 Slf4j(带有 loj4j2)的设置。但在启动时它会抛出

[java] Exception in thread "main" java.lang.ExceptionInInitializerError
[java] at jdk.nashorn.internal.lookup.MethodHandleFactory$StandardMethodHandleFunctionality.<init>(MethodHandleFactory.java:325)
[java] at jdk.nashorn.internal.lookup.MethodHandleFactory.<clinit>(MethodHandleFactory.java:103)
[java] at jdk.nashorn.internal.runtime.Context.initLoggers(Context.java:1404)
[java] at jdk.nashorn.internal.runtime.Context.<init>(Context.java:549)
[java] at jdk.nashorn.internal.runtime.Context.<init>(Context.java:466)
[java] at jdk.nashorn.api.scripting.NashornScriptEngine$1.run(NashornScriptEngine.java:129)
[java] at jdk.nashorn.api.scripting.NashornScriptEngine$1.run(NashornScriptEngine.java:125)
[java] at java.security.AccessController.doPrivileged(Native Method)
[java] at jdk.nashorn.api.scripting.NashornScriptEngine.<init>(NashornScriptEngine.java:125)
[java] at jdk.nashorn.api.scripting.NashornScriptEngineFactory.getScriptEngine(NashornScriptEngineFactory.java:148)
[java] at org.apache.logging.log4j.core.script.ScriptManager.<init>(ScriptManager.java:96)
[java] at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:214)
[java] at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:244)
[java] at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:545)
[java] at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:617)
[java] at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:634)
[java] at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:229)
[java] at org.apache.logging.log4j.core.async.AsyncLoggerContext.start(AsyncLoggerContext.java:76)
[java] at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:152)
[java] at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45)
[java] at org.apache.logging.log4j.LogManager.getContext(LogManager.java:194)
[java] at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:122)
[java] at org.apache.logging.log4j.jul.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:34)
[java] at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:46)
[java] at org.apache.logging.log4j.jul.LogManager.getLogger(LogManager.java:89)
[java] at java.util.logging.LogManager.demandLogger(LogManager.java:551)
[java] at java.util.logging.Logger.demandLogger(Logger.java:455)
[java] at java.util.logging.Logger.getLogger(Logger.java:502)
[java] at com.lmax.disruptor.FatalExceptionHandler.<clinit>(FatalExceptionHandler.java:27)
[java] at com.lmax.disruptor.dsl.ExceptionHandlerWrapper.<init>(ExceptionHandlerWrapper.java:8)
[java] at com.lmax.disruptor.dsl.Disruptor.<init>(Disruptor.java:66)
[java] at com.lmax.disruptor.dsl.Disruptor.<init>(Disruptor.java:105)
[java] at org.apache.logging.log4j.core.async.AsyncLoggerDisruptor.start(AsyncLoggerDisruptor.java:92)
[java] at org.apache.logging.log4j.core.async.AsyncLoggerContext.start(AsyncLoggerContext.java:75)
[java] at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:152)
[java] at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45)
[java] at org.apache.logging.log4j.LogManager.getContext(LogManager.java:307)
[java] at org.apache.log4j.LogManager$PrivateManager.getContext(LogManager.java:215)
[java] at org.apache.log4j.LogManager.getLogger(LogManager.java:74)
[java] at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:66)
[java] at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:270)
[java] at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:281)
[java] at com.aaa.aaa.AAAService.<clinit>(AAAService.java:45)
[java] Caused by: java.lang.NullPointerException
[java] at jdk.nashorn.internal.runtime.Context.initLoggers(Context.java:1404)
[java] at jdk.nashorn.internal.runtime.Context.<init>(Context.java:549)
[java] at jdk.nashorn.internal.runtime.Context.<init>(Context.java:466)
[java] at jdk.nashorn.api.scripting.NashornScriptEngine$1.run(NashornScriptEngine.java:129)
[java] at jdk.nashorn.api.scripting.NashornScriptEngine$1.run(NashornScriptEngine.java:125)
[java] at java.security.AccessController.doPrivileged(Native Method)
[java] at jdk.nashorn.api.scripting.NashornScriptEngine.<init>(NashornScriptEngine.java:125)
[java] at jdk.nashorn.api.scripting.NashornScriptEngineFactory.getScriptEngine(NashornScriptEngineFactory.java:148)
[java] at org.apache.logging.log4j.core.script.ScriptManager.<init>(ScriptManager.java:96)
[java] at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:214)
[java] at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:244)
[java] at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:545)
[java] at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:617)
[java] at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:634)
[java] at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:229)
[java] at org.apache.logging.log4j.core.async.AsyncLoggerContext.start(AsyncLoggerContext.java:76)
[java] at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:152)
[java] at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45)
[java] at org.apache.logging.log4j.LogManager.getContext(LogManager.java:194)
[java] at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:122)
[java] at org.apache.logging.log4j.jul.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:34)
[java] at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:46)
[java] at org.apache.logging.log4j.jul.LogManager.getLogger(LogManager.java:89)
[java] at java.util.logging.LogManager.demandLogger(LogManager.java:551)
[java] at java.util.logging.Logger.demandLogger(Logger.java:455)
[java] at java.util.logging.Logger.getLogger(Logger.java:502)
[java] at jdk.nashorn.internal.runtime.logging.DebugLogger.instantiateLogger(DebugLogger.java:84)
[java] at jdk.nashorn.internal.runtime.logging.DebugLogger.<init>(DebugLogger.java:77)
[java] at jdk.nashorn.internal.runtime.logging.DebugLogger.<clinit>(DebugLogger.java:55)
[java] ... 43 more
[java] 2017-05-24 11:07:18,278 main DEBUG Scala REPL Version: 2.0, Language: Scala, Threading: Not Thread Safe, Compile: true, Names: {scala}

有什么想法,如何解决这个问题吗?

最佳答案

我使用的是 Scala 2.12。然后我把它改回Scala 2.11。它解决了这个问题。

关于java - Akka 2.5 和 Slf4j 使用 nashorn 抛出 NPE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44155544/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com