Spring Could not Resolve placeholder

后端 未结 8 2059
说谎
说谎 2020-12-08 10:29

I\'m fairly new to spring so excuse me if this is a dumb question. When I try to launch a program I get the following error: java.lang.IllegalArgumentException: Could

相关标签:
8条回答
  • 2020-12-08 11:27

    If your config file is in a different path than classpath, you can add the configuration file path as a system property:

    java -Dapp.config.path=path_to_config_file -jar your.jar
    
    0 讨论(0)
  • 2020-12-08 11:29

    My solution was to add a space between the $ and the {.

    For example:

    @Value("${appclient.port:}")
    

    becomes

    @Value("$ {appclient.port:}")
    
    0 讨论(0)
提交回复
热议问题