Spring boot could not resolve placeholder in string

后端 未结 9 1125
悲哀的现实
悲哀的现实 2020-12-16 14:28

I am running spring-boot on an embedded tomcat server through maven with mvn clean install spring-boot:run. But every time I run it I get this error:

         


        
9条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-16 15:28

    If the above changes in pom.xml file still doesn't solve the problem try below option.

    Add the @PropertySource annotation at the top of your class

    @PropertySource(
        {
                "classpath:/application.properties",
                "classpath:/${spring.profiles.active}/application-${spring.profiles.active}.properties"
        }
    

    )

    If that still doesn't solve try adding the following annotation

    @EnableAutoConfiguration

    Salam

提交回复
热议问题