grpc-spring-boot-starter icon indicating copy to clipboard operation
grpc-spring-boot-starter copied to clipboard

[native image] Could not find reflection configuration resource "META-INF/native-image/io.github.lognet/grpc-spring-boot-starter/reflection-config.json"

Open kim-ddongs opened this issue 2 years ago • 7 comments

Hi,

I using this framework for grpc protocol support.

Meanwhile, i face problem when execute task bootBuildImage for build native image.

Buildpack is no problem. but graalvm steps have a problem.

Maybe, cause is 'grpc-spring-boot-starter' native-image.properties have some arguments that is "-H:ReflectionConfigurationResources=${.}/reflection-config.json"

How to solve this problem?

Thanks in advance.

version : 5.0.0

native build error log

    [creator]     [1/7] Initializing...                                            (0.0s @ 0.59GB)
    [creator]     Error: Could not find reflection configuration resource "META-INF/native-image/io.github.lognet/grpc-spring-boot-starter/reflection-config.json".
    [creator]     com.oracle.svm.core.util.UserError$UserException: Could not find reflection configuration resource "META-INF/native-image/io.github.lognet/grpc-spring-boot-starter/reflection-config.json".
    [creator]     	at com.oracle.svm.core.util.UserError.abort(UserError.java:73)
    [creator]     	at com.oracle.svm.hosted.config.ConfigurationParserUtils.lambda$parseAndRegisterConfigurations$2(ConfigurationParserUtils.java:96)
    [creator]     	at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:273)
    [creator]     	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
    [creator]     	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
    [creator]     	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
    [creator]     	at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:310)
    [creator]     	at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:734)
    [creator]     	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
    [creator]     	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
    [creator]     	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
    [creator]     	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    [creator]     	at java.base/java.util.stream.IntPipeline.reduce(IntPipeline.java:515)
    [creator]     	at java.base/java.util.stream.IntPipeline.sum(IntPipeline.java:473)
    [creator]     	at com.oracle.svm.hosted.config.ConfigurationParserUtils.parseAndRegisterConfigurations(ConfigurationParserUtils.java:113)
    [creator]     	at com.oracle.svm.hosted.reflect.ReflectionFeature.duringSetup(ReflectionFeature.java:232)
    [creator]     	at com.oracle.svm.hosted.NativeImageGenerator.lambda$setupNativeImage$16(NativeImageGenerator.java:918)
    [creator]     	at com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:85)
    [creator]     	at com.oracle.svm.hosted.NativeImageGenerator.setupNativeImage(NativeImageGenerator.java:918)
    [creator]     	at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:575)
    [creator]     	at com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:535)
    [creator]     	at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:403)
    [creator]     	at com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:580)
    [creator]     	at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:128)
    [creator]     	at com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus.main(NativeImageGeneratorRunner.java:610)

kim-ddongs avatar Mar 15 '23 08:03 kim-ddongs

Same issue only on latest release, 4.9.1 works fine

a-gaitian avatar Mar 24 '23 14:03 a-gaitian

I've removed reflection config json in latest build... Sorry. Will add it back

jvmlet avatar Mar 24 '23 17:03 jvmlet

@galik-ya @kim-ddongs , please try with 5.1.1-SNAPSHOT

jvmlet avatar Apr 11 '23 10:04 jvmlet

Hi,

Based on 5.1.1-SNAPSHOT, I built the project with graalvm Native and the build was succeed. But I got an run time exception as following. And, if the project is built in JVM, it can run without error. I don't know where I did wrong. Could you please help me to figure it out?

Exception: Error creating bean with name 'collectorGRpcServiceImpl': Instantiation of supplied bean failed Apr 12, 2023 5:34:52 PM org.apache.catalina.core.StandardService stopInternal INFO: Stopping service [Tomcat] 2023-04-12 17:34:52.618 ERROR 2500 --- [main ] org.springframework.boot.SpringApplication : [820 ] Application run failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'collectorGRpcServiceImpl': Instantiation of supplied bean failed

mobileharry avatar Apr 12 '23 10:04 mobileharry