kamoor
kamoor

Reputation: 2939

Latest Spring Boot upgrade is throwing Invalid property 'text[encryption] from SecurityProperties

I upgraded spring boot to latest release 1.2.0.RELEASE and now ends up with following exception.

used by: org.springframework.beans.NotWritablePropertyException: Invalid property 'text[encryption]' of bean class [org.springframework.boot.autoconfigure.security.SecurityProperties]: Cannot access indexed value in property referenced in indexed property path 'text[encryption]'; nested exception is org.springframework.beans.NotReadablePropertyException: Invalid property 'text[encryption]' of bean class [org.springframework.boot.autoconfigure.security.SecurityProperties]: Bean property 'text[encryption]' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:950)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:926)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:95)
at org.springframework.validation.DataBinder.applyPropertyValues(DataBinder.java:749)
at org.springframework.validation.DataBinder.doBind(DataBinder.java:645)
at org.springframework.boot.bind.RelaxedDataBinder.doBind(RelaxedDataBinder.java:119)
at org.springframework.validation.DataBinder.bind(DataBinder.java:630)
at org.springframework.boot.bind.PropertiesConfigurationFactory.doBindPropertiesToTarget(PropertiesConfigurationFactory.java:251)
at org.springframework.boot.bind.PropertiesConfigurationFactory.bindPropertiesToTarget(PropertiesConfigurationFactory.java:225)
at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.postProcessBeforeInitialization(ConfigurationPropertiesBindingPostProcessor.java:296)

Other dependencies used:

<spring.version>4.1.3.RELEASE</spring.version>
<spring-security.version>3.2.5.RELEASE</spring-security.version>
<spring-data.version>1.4.1.RELEASE</spring-data.version>

Any idea what could be the reason. Thanks for your help

Upvotes: 0

Views: 1640

Answers (1)

Ilya Ovesnov
Ilya Ovesnov

Reputation: 4257

I feel like you have the following property in your application.properties or application.yml:

security.text.encryption

You should not have any custom properties that starts from 'security' because of spring-boot will try to map it to the SecurityProperties.

SecurityProperties configuration:

@ConfigurationProperties(prefix = "security", ignoreUnknownFields = false)

Means it will fail on any unknown properties that started from 'security'

Upvotes: 5

Related Questions