close

[Fixed] java.lang.IllegalArgumentException: Could not resolve placeholder

Today We are Going To Solve java.lang.IllegalArgumentException: Could not resolve placeholder in java. Here we will Discuss All Possible Solutions and How this error Occurs So let’s get started with this Article.

How to Fix java.lang.IllegalArgumentException: Could not resolve placeholder Error?

  1. How to Fix java.lang.IllegalArgumentException: Could not resolve placeholder Error?

    To Fix java.lang.IllegalArgumentException: Could not resolve placeholder Error just Change the annotation. First of all, pass the parameter as: file:appclient.properties or classpath:appclient.properties.
    And after it change the annotation to: @PropertySource(value={"classpath:appclient.properties"}) It will help you.

  2. java.lang.IllegalArgumentException: Could not resolve placeholder

    To Fix java.lang.IllegalArgumentException: Could not resolve placeholder Error just Add the configuration file path as a system property. To solve this error just add the configuration file path as a system property: java -Dapp.config.path=path_to_config_file -jar your.jar

Solution 1 : Change the annotation

First of all, pass the parameter as: file:appclient.properties or classpath:appclient.properties.

And after it change the annotation to:

@PropertySource(value={"classpath:appclient.properties"})

It will help you.

Solution 2 : Add the configuration file path as a system property

To solve this error just add the configuration file path as a system property:

java -Dapp.config.path=path_to_config_file -jar your.jar

Conclusion

So these were all possible solutions to this error. I hope your error has been solved by this article. In the comments, tell us which solution worked? If you liked our article, please share it on your social media and comment on your suggestions. Thank you.

Also Read These Solutions

Leave a Comment