【发布时间】:2016-11-07 13:52:23
【问题描述】:
我已尝试使用我的应用程序的 jar 和 war 版本,但无论我做什么,SPRING_APPLICATION_JSON 在部署到 Elastic Beanstalk 时都会被忽略。当使用相同的 jar 在本地测试时,这是可行的。
export SPRING_APPLICATION_JSON='{"server": { "port": 5000 } }'
java -jar my-app-1.0.1-SNAPSHOT.jar
... snip useless output
2016-07-05 12:18:02.877 INFO 10654 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 5000 (http)
2016-07-05 12:18:02.886 INFO 10654 --- [ main] com.me.app.MyApplication : Started MyApplication in 22.827 seconds (JVM running for 23.514)
在 Elastic Beanstalk 中的 AWS 上设置相同的 JSON 时(显示 jar 版本)
但是当应用程序在 AWS 中启动时。日志显示它没有看到 server.port 的更新配置值
2016-07-05 15:58:33.511 INFO 2267 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
2016-07-05 15:58:33.520 INFO 2267 --- [ main] com.me.app.MyApplication : Started MyApplication in 37.746 seconds (JVM running for 47.043)
为什么这在本地有效,但在 Elastic Beanstalk 上无效?
【问题讨论】:
标签: java amazon-web-services spring-boot amazon-elastic-beanstalk