我的应用程序在resources文件夹中有application.yml,但是spring boot应用程序抱怨找不到application.properties

eh57zj3b  于 2021-08-20  发布在  Java
关注(0)|答案(0)|浏览(240)

我的应用程序在main和test resources文件夹中有application.yml,但是应用程序(spring boot 2.4 with maven)抱怨找不到application.properties。
下面是错误。

2021-07-08 04:37:33.381 ERROR   --- [           main] o.s.test.context.TestContextManager      : Caught exception while allowing TestExecutionListener [org.springframework.test.context.support.DependencyInjectionTestExecutionListener@bd4ee01] to prepare test instance [com.test.SomeTests@6a7aa675]

java.lang.IllegalStateException: Failed to load ApplicationContext
        at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:132)
...
Caused by: java.io.FileNotFoundException: class path resource [application.properties] cannot be opened because it does not exist
        at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:187)

我试图在网上找到解决方案,但找不到。请帮忙。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题