Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring, Skipped (empty) config file

I'm running spring in debug mode, and after struggling to get it to recognize an external properties file I finally got it to do so

Loaded config file 'file:C:/Users/udyj/git/hermes-mq-tool.lib/rte/application-ALD-INT.properties'

However right after that line

Skipped (empty) config file 'file:C:/Users/udyj/git/hermes-mq-tool.lib/rte/application-ALD-INT.properties'

The thing is though, it isn't empty

Name=ALD-INT
Queues=
QueueManager=whatever
TAS_MQS_PASSWORD=pw
TAS_MQS_USER=name

I'm running spring this way,

pb = new ProcessBuilder().inheritIO().command(java, "-noverify", "-cp", classpath, 
            String.format("-Dspring.config.location=%s", "C:\\Users\\udyj\\git\\hermes-mq-tool.lib\\rte\\application-ALD-INT.properties"),
            clazz.getCanonicalName()
            );

What does the empty config file thing mean?

like image 430
Steve Avatar asked Oct 05 '18 14:10

Steve


People also ask

Where is the spring configuration file?

In essence the Spring configuration files (that can have any name by the way, not just the generic applicationContext. xml ) are treated as classpath resources and filed under src/main/resources .

What is externalized configuration in spring boot?

Spring Boot lets you externalize your configuration so that you can work with the same application code in different environments. You can use properties files, YAML files, environment variables, and command-line arguments to externalize configuration.

What is the default configuration file in a spring boot project?

Using the Default Location By convention, Spring Boot looks for an externalized configuration file — application. properties or application. yml — in four predetermined locations in the following order of precedence: A /config subdirectory of the current directory.


1 Answers

This is an open issue

The misleading logging is an unfortunate side-effect of it being performed in a generic location that doesn't (and shouldn't) understand the difference between .properties and .yaml configuration files.

like image 161
mahfuj asif Avatar answered Nov 16 '22 03:11

mahfuj asif