You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to build a native image that uses gcloud java libraries. The first issue I encountered is
No instances of io.grpc.netty.shaded.io.netty.util.internal.logging.Slf4JLoggerFactory
are allowed in the image heap as this class should be initialized at image runtime.
Fatal error: org.graalvm.compiler.debug.GraalError: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: No instances of io.grpc.netty.shaded.io.netty.util.internal.logging.Slf4JLoggerFactory are allowed in the image heap as this class should be initialized at image runtime. Object has been initialized by the io.grpc.netty.shaded.io.netty.channel.ChannelOption class initializer with a trace:
at io.grpc.netty.shaded.io.netty.util.internal.logging.Slf4JLoggerFactory.<init>(Slf4JLoggerFactory.java:42)
at io.grpc.netty.shaded.io.netty.util.internal.logging.Slf4JLoggerFactory.<clinit>(Slf4JLoggerFactory.java:33)
at io.grpc.netty.shaded.io.netty.util.internal.logging.InternalLoggerFactory.useSlf4JLoggerFactory(InternalLoggerFactory.java:62)
at io.grpc.netty.shaded.io.netty.util.internal.logging.InternalLoggerFactory.newDefaultFactory(InternalLoggerFactory.java:42)
at io.grpc.netty.shaded.io.netty.util.internal.logging.InternalLoggerFactory.getDefaultFactory(InternalLoggerFactory.java:111)
at io.grpc.netty.shaded.io.netty.util.internal.logging.InternalLoggerFactory.getInstance(InternalLoggerFactory.java:134)
at io.grpc.netty.shaded.io.netty.util.internal.logging.InternalLoggerFactory.getInstance(InternalLoggerFactory.java:127)
at io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent.<clinit>(PlatformDependent.java:81)
at io.grpc.netty.shaded.io.netty.util.ConstantPool.<init>(ConstantPool.java:34)
at io.grpc.netty.shaded.io.netty.channel.ChannelOption$1.<init>(ChannelOption.java:36)
at io.grpc.netty.shaded.io.netty.channel.ChannelOption.<clinit>(ChannelOption.java:36)
. To fix the issue mark io.grpc.netty.shaded.io.netty.util.internal.logging.Slf4JLoggerFactory for build-time initialization with --initialize-at-build-time=io.grpc.netty.shaded.io.netty.util.internal.logging.Slf4JLoggerFactory or use the the information from the trace to find the culprit and --initialize-at-run-time=<culprit> to prevent its instantiation.
when I tried to apply the suggested fix I get another error that points to gax-grpc:
Error: Incompatible change of initialization policy for io.grpc.netty.shaded.io.netty.util.internal.logging.Slf4JLoggerFactory:
trying to change RUN_TIME from 'META-INF/native-image/com.google.api/gax-grpc/native-image.properties' in 'file:///.../com.google.api/gax-grpc/2.18.1/a3f2cca007aaa26868b4750e56b0af7ae63f5e3c/gax-grpc-2.18.1.jar' with 'io.grpc.netty.shaded.io.netty.util.internal.logging.Slf4JLoggerFactory'
to BUILD_TIME from command line with 'io.grpc.netty.shaded.io.netty.util.internal.logging.Slf4JLoggerFactory'
com.oracle.svm.core.util.UserError$UserException:
Incompatible change of initialization policy for io.grpc.netty.shaded.io.netty.util.internal.logging.Slf4JLoggerFactory: trying to change RUN_TIME from 'META-INF/native-image/com.google.api/gax-grpc/native-image.properties'
in 'file:///.../com.google.api/gax-grpc/2.18.1/a3f2cca007aaa26868b4750e56b0af7ae63f5e3c/gax-grpc-2.18.1.jar' with 'io.grpc.netty.shaded.io.netty.util.internal.logging.Slf4JLoggerFactory' to BUILD_TIME from command line with 'io.grpc.netty.shaded.io.netty.util.internal.logging.Slf4JLoggerFactory'
at com.oracle.svm.core.util.UserError.abort(UserError.java:72)
at com.oracle.svm.hosted.classinitialization.ClassInitializationConfiguration.insertRec(ClassInitializationConfiguration.java:102)
I'm trying to build a native image that uses
gcloudjava libraries. The first issue I encountered iswhen I tried to apply the suggested fix I get another error that points to gax-grpc: