Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kim-ddongs opened this issue Mar 15, 2023 · 4 comments

Comments

@kim-ddongs
Copy link

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)
@a-gaitian
Copy link
Contributor

Same issue only on latest release, 4.9.1 works fine

@jvmlet
Copy link
Collaborator

jvmlet commented Mar 24, 2023

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

jvmlet added a commit that referenced this issue Apr 11, 2023
Co-authored-by: Furer Alexander <furer.alexander@gmail.com>
@jvmlet
Copy link
Collaborator

jvmlet commented Apr 11, 2023

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

@mobileharry
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants