Skip to content

Servlet context initialization parameter for spring.config.location is ignored #6801

@yreifschneider

Description

@yreifschneider

I'm using Spring Boot 1.4.0 deployed as a war file to Tomcat 8.5. According to the documentantion, I should be able to configure the spring.boot.location configuration parameter by passing it via Servlet context initialization parameter.

If you are running in a container then JNDI properties (in java:comp/env) or servlet context initialization parameters can be used instead of, or as well as, environment variables or system properties.
http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html

When I add this line to my context.xml file in Tomcat
<Parameter name="spring.config.location" value="file:/some/path/" />
the application.properties file at this path is ignored and not read.

If I however use a JNDI entry like
<Environment name="spring.config.location" value="file:/some/path/" type="java.lang.String" />
the application.properties file is read and will be used.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions