title: Spring XML configuration, default-lazy-init and spring properties not working
body: <p>I would like to determine if my beans are lazy init or not depending on a property loaded from a properties file.</p>
  
  <p>My configuration file has a lot of properties in it that are parsed properly except for the one in default-lazy-init.</p>
  
  <p>I've tried to set the lazy-init directly on a bean and i'm still having an exception.</p>
  
  <p>Is the another way to do it?</p>
  
  <p><strong>config.properties :</strong></p>
  
  <pre><code>lazyInit=true    
  ...
  </code></pre>
  
  <p><strong>springConfiguration-datasource.xml :</strong></p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:context="http://www.springframework.org/schema/context"
          xmlns:tx="http://www.springframework.org/schema/tx"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
          http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
          http://www.springframework.org/schema/context
          http://www.springframework.org/schema/context/spring-context-3.2.xsd
          http://www.springframework.org/schema/tx 
          http://www.springframework.org/schema/tx/spring-tx-3.2.xsd"&gt;
  
    &lt;bean name="tDatasource" class="bitronix.tm.resource.jdbc.PoolingDataSource" init-method="init" destroy-method="close" lazy-init="${lazyInit}"&gt;
  ...
  </code></pre>
  
  <p><strong>Exception :</strong> </p>
  
  <pre><code>java.lang.IllegalStateException: Failed to load ApplicationContext
      at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:99)
      at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:122)
      at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:105)
      at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:74)
      at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:312)
      at com.icod.solapCore.test.SpringSupport.prepareTest(SpringSupport.java:19)
      at com.icod.solapCore.test.SolapCoreJunit4TestRunner.createTest(SolapCoreJunit4TestRunner.java:50)
      at org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRunner.java:251)
      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
      at org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:248)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
      at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
      at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
      at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
      at com.icod.solapCore.test.SolapCoreJunit4TestRunner.run(SolapCoreJunit4TestRunner.java:42)
      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
  Caused by: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 20 in XML document from class path resource [springConfiguration-datasource.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 20; columnNumber: 144; cvc-datatype-valid.1.2.1: '${lazyInit}' is not a valid value for 'NMTOKEN'.
  </code></pre>