0

I'm trying to deploy a spring boot application packaged as a war file to tomcat 8. I would also like to have the properties come from a config server. This config server can be a simple spring boot executable jar file, connected to git.

I can't see to find a way to tell the "classic" tomcat (non-spring-boot) to look for configuration in the external config server. There's no "bootstrap.yml" for tomcat that I'm aware of?

Any assistance would be great.

Thanks.

odedia
  • 931
  • 2
  • 11
  • 27
  • have you tried environment variables or java system properties? – spencergibb Aug 22 '17 at 18:02
  • Yes, tried modifying JAVA_OPTS to add settings from bootstrap.yml, didn't seem like it made any difference. – odedia Aug 22 '17 at 19:19
  • Hmm... Just noticed this: https://github.com/spring-cloud/spring-cloud-config/issues/715 I think the root cause might be that I am still using ContextLoaderListener in web.xml. Will remove it and report back. – odedia Aug 22 '17 at 20:12
  • Can you add what you have tried? – spencergibb Aug 23 '17 at 00:04

1 Answers1

0

The problem was that my web.xml still used the legacy implementation of ContextLoaderListener. This is not needed if your war is packaged as a spring boot application. Actually, this is what caused the problems. When I removed it, it let the configuration be picked up by spring boot itself.

See response here from Dave Syer:

https://github.com/spring-cloud/spring-cloud-config/issues/715

odedia
  • 931
  • 2
  • 11
  • 27