1

I have a Spring Boot Web application XX, which in turn is using a library, YY, built using Spring. I have declared YY library details in XX's POM.

In my YY library I have a Cinfig class annotated with following :

    @Configuration
    @PropertySource({ "classpath:abc.properties" })
    class YYLibraryConfig {

I have declared abc.properties in src/main/resources of YY library. Now when I am running Spring Boot application XX , I am getting the following error :

InvocationTargetException: Failed to process import candidates for configuration class [com.sample.YYLibraryConfig]; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'abc.properties' in string value "classpath:${abc.properties}"  
Santosh Pashupati
  • 499
  • 1
  • 6
  • 16
  • Can you post your application.properties and Application.java – utsav anand Nov 03 '17 at 08:55
  • How are you building your application ? As an executable jar ? Are you using the Spring Boot Maven Plugin to create this ? If not you need to. – PaulNUK Nov 03 '17 at 08:56
  • Also see: https://stackoverflow.com/questions/38792031/springboot-making-jar-files-no-auto-configuration-classes-found-in-meta-inf and https://stackoverflow.com/questions/39375016/failed-to-process-import-candidates-for-configuration-class – PaulNUK Nov 03 '17 at 08:57
  • 1
    Try to remove "**{**" and "**}**", use this one: `@PropertySource("classpath:abc.properties")`. – LHCHIN Nov 03 '17 at 08:59

0 Answers0