title: getting Could not resolve placeholder while reading yml values in spring boot
body: <p>I'm using spring boot and using this value in my application.yml</p>
  <pre><code>config:
    username: abc
    password: xyz
  </code></pre>
  <p>In my class, I'm utilizing it this way -</p>
  <pre><code>@Value(&quot;${config.username}&quot;)
      private String username;
  </code></pre>
  <p>I'm getting the following error -</p>
  <pre><code>Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'config.username' in value &quot;${config.username}&quot;
  </code></pre>
  <p>However if I use this in my application.yml file, it works. Can you please tell me what I'm doing wrong here?</p>
  <pre><code>config.username: abc
  config.password: xyz
  </code></pre>