title: Default value for spring @Value annotation
body: <p>I have a property annotated with <code>@Value</code>, normally populated from context.xml (jndi/tomcat)</p>
  
  <pre><code>@Value("${some.property}")
  private String property
  </code></pre>
  
  <p>This works fine, but we have installations of our software, where that property shouldn't be configured. </p>
  
  <p>However, if the property is missing, I get a <code>javax.naming.NameNotFoundException: Name [some.property] is not bound in this Context. Unable to find [some.property].</code>, which is logical.</p>
  
  <p>I tried fixing this, by adding a default value this way: </p>
  
  <pre><code>@Value("${some.property:some_property_not_configured}")
  private String property
  </code></pre>
  
  <p>However, I still get the same error.</p>
  
  <p>Any ideas how to prevent/fix this?</p>
  
  <p>I would like to use this in a Spring 3.2.x and a Spring 4+ environment. 
  The annotation @Value is available from Spring 3+</p>
  
  <p><strong>UPDATE:</strong>
  The problem was not with the @Value annotation, but in app-config.xml</p>
  
  <pre><code>&lt;entry key="some.property"&gt;
      &lt;jee:jndi-lookup jndi-name="java:comp/env/some.property" /&gt;
  &lt;/entry&gt;
  </code></pre>
  
  <p>This caused the error at startup time!</p>
  
  <p>However, if I add <code>default-value="something"</code> here, it still fails with the same error</p>