java.io.FileNotFoundException:类路径资源[application.properties]

java.io.FileNotFoundException:类路径资源[application.properties],java,spring,Java,Spring,我删除了application.properties文件并包含application.yml而不是它。突然,我开始出现以下FileNotFoundException错误 我认为这将正常工作,我不需要任何配置。这里有什么问题?我假设您使用的是Spring boot。从最低配置来看,它应该自动支持应用程序。属性或application.yml文件。错误指向旧的.properties文件。请检查您的pom或gradle文件,使其不指向特定的配置文件,或者清理目标文件夹并重建项目。您是否可以提供Bil

我删除了application.properties文件并包含application.yml而不是它。突然,我开始出现以下FileNotFoundException错误


我认为这将正常工作,我不需要任何配置。这里有什么问题?

我假设您使用的是Spring boot。从最低配置来看,它应该自动支持应用程序。属性或application.yml文件。错误指向旧的.properties文件。请检查您的pom或gradle文件,使其不指向特定的配置文件,或者清理目标文件夹并重建项目。

您是否可以提供
BillingApplication
flie source?您是否依赖于@mirzak否我没有such@m.antkowicz代码中只有main方法。为了确保它有效,您可以添加application.properties文件,然后重试
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]