spring-cloud-alibaba graalvm build success but run fail

bakd9h0s  于 2个月前  发布在  Spring
关注(0)|答案(8)|浏览(57)

win10

java version "17.0.8" 2023-07-18 LTS
Java(TM) SE Runtime Environment Oracle GraalVM 17.0.8+9.1 (build 17.0.8+9-LTS-jvmci-23.0-b14)
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 17.0.8+9.1 (build 17.0.8+9-LTS-jvmci-23.0-b14, mixed mode, sharing)

Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)
Maven home: C:\Program Files\JetBrains\IntelliJ IDEA 2022.2.1\plugins\maven\lib\maven3\bin..
Java version: 17.0.8, vendor: Oracle Corporation, runtime: C:\Users\Administrator.jdks\graalvm-jdk-17.0.8+9.1
Default locale: zh_CN, platform encoding: GBK
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

pom info:

<properties>
    <java.version>17</java.version>
    <spring-cloud.version>2023.0.3</spring-cloud.version>
    <spring-cloud-alibaba.version>2023.0.1.2</spring-cloud-alibaba.version>
</properties>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>3.3.2</version>
</parent>

    <dependency>
        <groupId>com.alibaba.cloud</groupId>
        <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
    </dependency>

    <dependency>
        <groupId>com.alibaba.cloud</groupId>
        <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
    </dependency>

run cmd:
mvn native:compile -Pnative

falq053o

falq053o1#

@yuluo-yx
Is there a solution? At present, it is ruled out that there are some objects that have not implemented reflection

siv3szwd

siv3szwd2#

@yuluo-yx Found that @ RefreshScope is not effective in the application

gr8qqesn

gr8qqesn3#

maybe the question from nacos, let me check.

x4shl7ld

x4shl7ld4#

@mulzhang Can you provide an example to recurrent it?

eanckbw9

eanckbw96#

I also noticed that @ RefreshScope is not working

56lgkhnf

56lgkhnf7#

I am trying to provide feedback through AI

exec:

java -agentlib:native-image-agent=config-output-dir=./src/main/resources/META-INF/native-image -jar
then 
mvn --no-transfer-progress native:compile -Pnative

is runing ok !!
I have reason to believe that some configuration files are missing.

jjjwad0x

jjjwad0x8#

I am trying to provide feedback through AI

exec: java -agentlib:native-image-agent=config-output-dir=./src/main/resources/META-INF/native-image -jar then mvn --no-transfer-progress native:compile -Pnative is runing ok !! I have reason to believe that some configuration files are missing.

amazing,

相关问题