Closed KillerJmc closed 8 months ago
hello , you need to run the app with the tracing agent and generate the config temporarily in src/main/resources
java -DspringAot=true -agentlib:native-image-agent=config-output-dir=src/main/resources/META-INF/native-image -jar target/myapp-0.0.1-SNAPSHOT.jar
when the app is started , use CTRL + C
to shutdown it , and you will see the following automatically generated files
mvn -Pnative native:compile
@ruansheng8 Thank you! After I used this method, it worked successfully on both Ubuntu and Windows. Could you add this reflect information automatically while runing mvn -Pnative native:compile
in next release version?
@ruansheng8 Thank you! After I used this method, it worked successfully on both Ubuntu and Windows. Could you add this reflect information automatically while runing
mvn -Pnative native:compile
in next release version?
Do you mean to add the corresponding reflection file? This file needs to be generated according to your application, so there is no way to add default files.
@KillerJmc Most components are currently not compatible with AOT
, it may be a better choice to use agent
to generate reflection files in the short term.
@ruansheng8 Oh, I see. I hope Nacos
and the other components can support AOT
soon. Thank you for your hard work!
Do you mean to add the corresponding reflection file? This file needs to be generated according to your application, so there is no way to add default files.
@steverao No. I mean add AOT
support in Nacos
project config files which related to AOT info generation using Spring Native API.
@ruansheng8 Thank you! After I used this method, it worked successfully on both Ubuntu and Windows. Could you add this reflect information automatically while runing
mvn -Pnative native:compile
in next release version?
Using RuntimeHintsRegistrar
may solve this problem, but it will take some time to analyze the part of each component that needs to be supported by AOT
Using
RuntimeHintsRegistrar
may solve this problem, but it will take some time to analyze the part of each component that needs to be supported byAOT
@ruansheng8 Yes, the reflection information analysis is easy for graalvm but consumes runtime. If we don't solve it in this way, It is harder for us to write common config files which can include all the classes we need in runtime and make sure it costs less runtime than using graalvm to analyse directly. There may exist an easier way to solve this problem...
ORACLE官方有一个graalvm-reachability-metadata库,用来维护各个开发者把自己维护的库的AOT配置上传上去,在运行mvn -Pnative native:compile 时除去自己可以用RuntimeHintsRegistrar注册配置外会默认拉取这个repo里的配置信息,nacos 只要把自己的配置信息整理出来提交到这个repo就行了 @ruansheng8
ORACLE官方有一个graalvm-reachability-metadata库,用来维护各个开发者把自己维护的库的AOT配置上传上去,在运行mvn -Pnative native:compile 时除去自己可以用RuntimeHintsRegistrar注册配置外会默认拉取这个repo里的配置信息,nacos 只要把自己的配置信息整理出来提交到这个repo就行了 @ruansheng8
graalvm-reachability-metadata
这块内容目前社区已经在整理了,后续会和其他相关社区一起将对应的配置上传过去
@ruansheng8 其他相关社区是指SPRING CLOUD ALIBABA的其他组件的client端吗,还有就是nacos server 之后有发布native image版本的计划吗
@karl-chanel 是的, 包括SCA项目集成的相关项目, SCA这边会对相关的starter模块进行native支持, 至于Nacos Server的Native Image相关版本发布计划由Nacos社区那边进行.
@ruansheng8 其他相关社区是指SPRING CLOUD ALIBABA的其他组件的client端吗,还有就是nacos server 之后有发布native image版本的计划吗
最终的形态应该是SCA这则仅采集自身模块源代码中的动态特性,将其组织成为配置文件上传到Oracle的metadata仓库,SCA中其他组件,比如Nacos/Sentinel/Seata/RocketMQ项目客户端的动态特性配置文件需要由相关社区去采集与上传,因为他们的客户端不仅仅只是被SCA项目所依赖,其他也有用户直接使用的其客户端,所以他们自己维护和处理是很有必要的。这块社区后续会跟相关社区同步相关意见,不过你个人作为用户,比较着急的话你也可以给相关社区留言。
mark
This issue has been open 30 days with no activity. This will be closed in 7 days.
Which Component Nacos Discovery
Describe the bug I ran
mvn native:compile
on Ubuntu and successfully got an executable native file. When I started this app, I got some error logs and then the app shutdown. And then I also did this work on Windows and it failed because of the same reason!To Reproduce Native App Running logs:
Maven pom file:
mvn native:compile
running logs: