title: why spring boot @Value populating not working
body: <p>I have a spring service:</p>
  <pre><code>@Service
  public class AuthorizationServiceImpl implements AuthorizationService {
  
  @Value(&quot;${local.address}&quot;)
  private String localIP;
  
  private final String LOCALHOST_IPV4 = &quot;127.0.0.1&quot;;
  private final String LOCALHOST_IPV6 = &quot;0:0:0:0:0:0:0:1&quot;;
  
  @CrossOrigin(origins = &quot;*&quot;)
  @Override
  public boolean isAuthorized(String token, HttpServletRequest request) {
      try {
          TokenUserModel user = new TokenUserModel();
          user.setSessionID(&quot;&quot;);
          user = getTokenUserModel(token);
          IServiceAAA client = new ServiceAAA().getBasicHttpBindingIServiceAAA();
          int systemId = client.getUserSystemId(&quot;InvoiceAdmin&quot;);
  
          String xRealIP = request.getRemoteAddr();
          String ipAddress = xRealIP.equals(LOCALHOST_IPV4) || xRealIP.equals(LOCALHOST_IPV6) ? localIP : xRealIP;
          String userAgent = request.getHeader(&quot;User-Agent&quot;);
          int response = client.checkPermissionAndUserData(user.getSessionID(), &quot;Admin&quot;,
                  userAgent,
                  ipAddress, systemId, systemId, &quot;&quot;);
          return response == 0;
      } catch (Exception ex) {
          throw new AuthorizationException(AuthorizationError.ERR_WHILE_AUTHORISATION);
      }
  }
  </code></pre>
  <p>}</p>
  <p><code>@Value(&quot;${local.address}&quot;)</code><br>
  <code>private String localIP;</code> - this line of code didn't working, not populating local.address field from application.properties:</p>
  <pre><code>local.address=10.10.16.13
  </code></pre>
  <p>Update:</p>
  <ol>
  <li><p>I have 3 application properties file for spring profiles, named:
  <strong>application.properties</strong>,<strong>application-dev.properties</strong>,<strong>application-prod.properties</strong>,
  my current active profile is <strong>application-dev.properties</strong>
  ('spring.profiles.active=dev' - it's inside of my
  application.properties file).</p>
  </li>
  <li><p>I'm sure that 'local.address'
  property is defined in application-dev.properties</p>
  <pre><code>    local.address=10.10.16.13
  </code></pre>
  </li>
  <li><p><strong>AuthorizationService</strong> is a just interface that <strong>AutheroziationServiceImpl</strong> impliments.</p>
  </li>
  </ol>
  <pre><code>public interface AuthorizationService {
      boolean isAuthorized(String token, HttpServletRequest request) throws UnsupportedEncodingException;
  
      void logout(String token) throws UnsupportedEncodingException;
  
      TokenUserModel getTokenUserModel(String token) throws UnsupportedEncodingException;
  }
  </code></pre>
  <p>I'm using it in constructor of one of controllers:</p>
  <pre><code>@Autowired
      public AuthorizationController(AuthorizationService authorizationService) {
          this.authorizationService = authorizationService;
      }
      private final AuthorizationService authorizationService;
  
  </code></pre>
  <ol start="4">
  <li>Yes, it's spring managed bean annotated as <code>@Service</code></li>
  </ol>