Reputation: 12417
I deleted the application.properties file and included the application.yml instead of it. Suddenly, I started to get the following FileNotFoundException error;
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.monytyz.billing.BillingApplication]; nested exception is java.io.FileNotFoundException: class path resource [application.properties] cannot be opened because it does not exist
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:189) ~[spring-context-5.3.1.jar:5.3.1]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:336) ~[spring-context-5.3.1.jar:5.3.1]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:252) ~[spring-context-5.3.1.jar:5.3.1]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:285) ~[spring-context-5.3.1.jar:5.3.1]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:99) ~[spring-context-5.3.1.jar:5.3.1]
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:751) ~[spring-context-5.3.1.jar:5.3.1]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:569) ~[spring-context-5.3.1.jar:5.3.1]
I thought this will work naturally and I won't need any configuration for this. What's the issue here?
Upvotes: 0
Views: 5552
Reputation: 163
I am assuming you are using the Spring boot. From the minimal configuration, it should automatically support application. properties or application.yml files. The error points to the old .properties file. Either check your pom or gradle file to not point on a specific config file or clean the target folder and rebuild the project.
Upvotes: 1