小编Spi*_*ica的帖子

GraalVM 本机映像无法处理日志

我尝试做的事情:

  1. mvn package -Dpackaging=docker-native -Dmicronaut.runtime=lambda -Pgraalvm

  2. 我得到什么:

Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: 
No instances of org.apache.logging.slf4j.SLF4JLogger 
are allowed in the image heap as this class should be initialized at image runtime.
Run Code Online (Sandbox Code Playgroud)
  1. 好的!让我跟踪实例化并找到问题:
[INFO] Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: No instances of org.apache.logging.slf4j.SLF4JLogger are allowed in the image heap as this class should be initialized at image runtime. Object has been initialized by the org.hibernate.internal.util.SerializationHelper class initializer with a trace: 
    at org.apache.logging.slf4j.SLF4JLogger.<init>(SLF4JLogger.java:41)
    at org.apache.logging.slf4j.SLF4JLoggerContext.getLogger(SLF4JLoggerContext.java:36)
    at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:666)
    at org.jboss.logging.Log4j2Logger.<init>(Log4j2Logger.java:36)
    at org.jboss.logging.Log4j2LoggerProvider.getLogger(Log4j2LoggerProvider.java:30)
    at org.jboss.logging.Log4j2LoggerProvider.getLogger(Log4j2LoggerProvider.java:26)
    at org.jboss.logging.Logger.getLogger(Logger.java:2465)
    at …
Run Code Online (Sandbox Code Playgroud)

java logging graalvm micronaut graalvm-native-image

5
推荐指数
1
解决办法
2530
查看次数

标签 统计

graalvm ×1

graalvm-native-image ×1

java ×1

logging ×1

micronaut ×1