title: spring-boot property exception while externalizing datasource properties and using actuator
body: <p>Im creating a small application using spring-boot + gorm + sqlserver datasource (very similar to Tim Yates' <a href="https://github.com/timyates/data-gorm-mysql/" rel="nofollow">https://github.com/timyates/data-gorm-mysql/</a>). </p>
  
  <p>My datasource properties are in application.properties:</p>
  
  <pre><code>dbDriverClassName=...
  dbUsername=...
  </code></pre>
  
  <p>My build.gradle has</p>
  
  <pre><code>compile("org.springframework.boot:spring-boot-starter-web")
  compile("org.grails:gorm-hibernate4-spring-boot:1.0.0.RC1")
  </code></pre>
  
  <p>It works fine. But when I add the actuator to build.gradle, I get errors:</p>
  
  <p><code>compile("org.springframework.boot:spring-boot-starter-actuator")</code></p>
  
  <p>UPDATE (full stacktrace)</p>
  
  <pre><code>thread "main"                                                                                                                                                                              org.springfra
  mework.beans.factory.BeanCreationException: Error creating bean with name 'environmentEndpoint': Could not bind properties; nested exception is org.springframework.beans.NotWritablePropertyException:
  Invalid property 'dbUsername' of bean class [org.springframework.boot.actuate.endpoint.EnvironmentEndpoint]: Bean property 'dbUsername' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
          at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.postProcessBeforeInitialization(ConfigurationPropertiesBindingPostProcessor.java:321)
          at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.postProcessBeforeInitialization(ConfigurationPropertiesBindingPostProcessor.java:278)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:407)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1545)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
  
  
  
  
                  at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
  2014-04-05 08:40:09.661  INFO 8136 --- [           main] utoConfigurationReportLoggingInitializer :
  
  Error starting ApplicationContext. To display the auto-configuration report enabled debug logging (start with --debug)
  
  
          at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
          at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703)
          at org.springframework.context..AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)
          at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
          at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:120)
          at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:619)
          at org.springframework.boot.SpringApplication.run(SpringApplication.java:306)
          at org.springframework.boot.SpringApplication.run(SpringApplication.java:880)
          at org.springframework.boot.SpringApplication$run.call(Unknown Source)
          at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
          at gov.texas.iph.IphApplication.main(IphApplication.groovy:25)
  Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'dbUsername' of bean class [org.springframework.boot.actuate.endpoint.EnvironmentEndpoint]: Bean property 'dbUsername' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
          at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1064)
          at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:922)
          at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:82)
          at org.springframework.validation.DataBinder.applyPropertyValues(DataBinder.java:728)
          at org.springframework.validation.DataBinder.doBind(DataBinder.java:624)
          at org.springframework.boot.bind.RelaxedDataBinder.doBind(RelaxedDataBinder.java:84)
          at org.springframework.validation.DataBinder.bind(DataBinder.java:609)
          at org.springframework.boot.bind.PropertiesConfigurationFactory.doBindPropertiesToTarget(PropertiesConfiguratory.java:275)
          at org.springframework.boot.bind.PropertiesConfigurationFactory.bindPropertiesToTarget(PropertiesConfigurationFactory.java:225)
          at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.postProcessBeforeInitialization(ConfigurationPropertiesBindingPostProcessor.java:318)
          ... 21 more
  :bootRun FAILED
  </code></pre>
  
  <p>What am I missing? 
  Thanks!</p>