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

模块apollo开启提前加载后基座静态合并启动时模块apollo初始化报错 #167

Closed
xiaofc999 opened this issue Mar 21, 2024 · 2 comments
Assignees

Comments

@xiaofc999
Copy link

xiaofc999 commented Mar 21, 2024

Describe the question or bug

如果模块的apollo打开了提前加载apollo.bootstrap.eagerLoad.enabled=true,然后基座和模块一起静态启动的话,模块启动阶段apollo初始化会报错

Steps to reproduce

基座和模块都依赖apollo, 其模块中的apollo没有设置为provided, 模块中的apollo.bootstrap.eagerLoad.enabled=true
选择静态合并启动-Dcom.alipay.sofa.ark.static.biz.dir=./biz
企业微信截图_17110277636245

image

image

Environment

  • apollo 16.0
  • springboot 2.3.12
  • Koupleless version (see CURRENT_VERSION.txt): 1.0.0
  • SOFAArk version: 2.2.7
  • JVM version (e.g. java -version):jdk8
  • OS version (e.g. uname -a):
  • Kubernetes version:
@xiaofc999
Copy link
Author

xiaofc999 commented Mar 28, 2024

apollo打开了提前加载apollo.bootstrap.eagerLoad.enabled的话
模块启动时ConfigFileApplicationListener里加载apollo的EnvironmentPostProcessor的问题
企业微信截图_17116068001748

这个问题貌似springboot2.5.x版本做了优化的口子
spring-projects/spring-boot#26126
否则只能自己去加个ark-plugin去覆盖ConfigFileApplicationListener改下这边加载EnvironmentPostProcessor的逻辑把当前的BizClassloader作为参数。
不知道是否还有其他更好的解决方案。

@gaosaroma gaosaroma self-assigned this Apr 8, 2024
@gaosaroma
Copy link
Collaborator

gaosaroma commented Apr 19, 2024

目前较为合适的方案是写一个 ark-plugin 去适配 springboot 2.3.x ,相同的问题见 #188
该问题已经修复,见 koupleless/runtime#31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

No branches or pull requests

3 participants