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打包后执行报错 #1

Open
jgaybjone opened this issue Jul 21, 2021 · 11 comments
Open

native打包后执行报错 #1

jgaybjone opened this issue Jul 21, 2021 · 11 comments

Comments

@jgaybjone
Copy link

7月 21, 2021 8:29:47 下午 org.github.keking.apollo.ApolloConfigSourceProvider
INFO: 加载apollo的namespaces:application,datasource,GLP.xxl-job-common,bootstrap
7月 21, 2021 8:29:47 下午 io.quarkus.runtime.ApplicationLifecycleManager run
ERROR: Failed to start application (with profile prod)
java.lang.IllegalStateException: No implementation defined in /META-INF/services/com.ctrip.framework.apollo.internals.Injector, please check whether the file exists and has the right implementation class!
at com.ctrip.framework.foundation.internals.ServiceBootstrap.loadFirst(ServiceBootstrap.java:15)
at com.ctrip.framework.apollo.build.ApolloInjector.getInjector(ApolloInjector.java:20)
at com.ctrip.framework.apollo.build.ApolloInjector.getInstance(ApolloInjector.java:35)
at com.ctrip.framework.apollo.ConfigService.getManager(ConfigService.java:25)
at com.ctrip.framework.apollo.ConfigService.getConfig(ConfigService.java:61)
at org.github.keking.apollo.ApolloConfigSourceProvider.getConfigSources(ApolloConfigSourceProvider.java:37)
at io.quarkus.runtime.configuration.ConfigUtils.addSourceProvider(ConfigUtils.java:167)
at io.quarkus.runtime.configuration.ConfigUtils.addSourceProviders(ConfigUtils.java:181)
at io.quarkus.runtime.generated.Config.readConfig(Config.zig:1522)
at io.quarkus.deployment.steps.RuntimeConfigSetup.deploy(RuntimeConfigSetup.zig:60)
at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:403)
at io.quarkus.runtime.Application.start(Application.java:101)
at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:101)
at io.quarkus.runtime.Quarkus.run(Quarkus.java:66)
at io.quarkus.runtime.Quarkus.run(Quarkus.java:42)
at io.quarkus.runtime.Quarkus.run(Quarkus.java:119)
at io.quarkus.runner.GeneratedMain.main(GeneratedMain.zig:29)

@klboke
Copy link
Contributor

klboke commented Jul 22, 2021

上下文描述详细点,或者提供个 demo

@jgaybjone
Copy link
Author

jgaybjone commented Jul 22, 2021

上下文描述详细点,或者提供个 demo
项目地址
https://github.com/jgaybjone/quarkus-config-demo
mvn clean package -Pnative -Dmaven.test.skip=true
打包编译后
执行config-quickstart/target/config-quickstart-1.0.0-SNAPSHOT-runner 就报上面的错误

@klboke
Copy link
Contributor

klboke commented Jul 22, 2021

quarkus-apollo-config 需要以 root 项目打包,不能作为其他项目的子模块

@klboke
Copy link
Contributor

klboke commented Jul 22, 2021

image
改成这样就可以了,还在一个代码仓库里

@jgaybjone
Copy link
Author

image
root了,还是没成功

@klboke
Copy link
Contributor

klboke commented Jul 22, 2021

清理下之前的 build ,重新打包

@jgaybjone
Copy link
Author

image
每次打包都是 先clean的,没效果

@klboke
Copy link
Contributor

klboke commented Jul 22, 2021

image
我这里是ok的,jdk 需要 11 以上,要么就是你本地环境问题

@jgaybjone
Copy link
Author

idea 启动没问题, 打包成native 执行文件不行

@klboke
Copy link
Contributor

klboke commented Jul 22, 2021

这个当前可能还不支持,受限于 apollo-client 本身有其他的依赖,有反射序列化等代码。当前这个库只支持 jvm 模式运行

@jgaybjone
Copy link
Author

好的

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

2 participants