Intellij not finding the config file

Answered

I have an application that I re-downloaded (it's a Maven project) and suddenly I am unable to deploy it due to Spring Boot not finding the values in the config file. I have checked the config file and the values are there, I tried rebuilding and nothing happened, I cleaned and installed my project a bunch too and still nothing changed. When I do build the jar the config file is in it, so I am not sure whats happening. 

I have tried everything and I cannot get it to work again. Any help is appreciated. 

0
3 comments

What IDE version do you use? What is the exact error? Please post complete textual output when you launch Run/Debug Configuration and the Run/Debug Configuration screenshot. Sample project would be very helpful. Thanks.

0
Avatar
Permanently deleted user

My IDE version is 2017.3.5(Ultimate). The error that occurs is this (changing the names of the properties)

Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'property.value' in value "${property.value}"
at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:174)
at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:126)
at org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:236)
at org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders(AbstractPropertyResolver.java:210)
at org.springframework.context.support.PropertySourcesPlaceholderConfigurer$2.resolveStringValue(PropertySourcesPlaceholderConfigurer.java:172)
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveEmbeddedValue(AbstractBeanFactory.java:831)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1086)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366)
... 71 more

 

I can't post a sample project due to this proprietary, I'm sorry. It seems as though Spring Boot isn't finding the whole config files as well, not just the values. I tried to override it by putting it into my VM options and it just went to the next value. 

0

Are you sure the issue is caused by not found config file (e.g. check this thread)? When you use Spring Boot run configuration as a classpath it uses the module's output directory of the module, specified in Use classpath of module option in configuration so you can check that the file is indeed present in that directory.

0

Please sign in to leave a comment.