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

关于使用springboot生成的war包部署到tomcat下配置读取错误的问题 #1993

Open
tgwang opened this issue Feb 21, 2019 · 4 comments
Labels
bug Categorizes issue or PR as related to a bug. kind/report-problem Categorizes issue when someone report the problem he/she meeted

Comments

@tgwang
Copy link

tgwang commented Feb 21, 2019

使用springboot开发的项目,使用生成war包形式部署到tomcat下,如果部署多个,会出现 后启动的一直读取第一个启动的配置信息,导致配置读取错误或者项目启动失败,例如:

tomcat
    |- A应用
        |- appid配置:aa
    |- B应用
        |- appid配置:bb

如果A应用先启动,当B启动时,获取的appid是A的appid(即:aa,理论上应该是bb),
通过源码发现,使用spring boot 时会实现EnvironmentPostProcessor.postProcessEnvironment方法,其中会将appid等信息通过System.setProperty设置成进程全局属性,导致此问题,由于在项目中存在多处System.setProperty设置属性操作,还望在修改此问题时评估其他属性是否有影响。

非常感谢!

@tianmingxing
Copy link

一个应用一个tomcat,隔离开就可以了。

@nobodyiam nobodyiam added the bug Categorizes issue or PR as related to a bug. label Feb 23, 2019
@nobodyiam
Copy link
Member

感谢反馈,这个是一个bug

@apporoad
Copy link

apporoad commented Jul 5, 2019

请问什么时候修复这个问题,也遇到了

@apporoad
Copy link

@OverRide
public void initialize(ConfigurableApplicationContext context) {
super.initialize(context);
System.setProperty("app.id", "");
}

@Anilople Anilople added the kind/report-problem Categorizes issue when someone report the problem he/she meeted label Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Categorizes issue or PR as related to a bug. kind/report-problem Categorizes issue when someone report the problem he/she meeted
Projects
None yet
Development

No branches or pull requests

5 participants