Home  >  Forum  >  Spring
Post New Query

Failed to convert property value of type 'java.lang.String' to required type

joined on
April 11,2013
Asked on April 11,2013
Hi I am new to spring and getting below exception.

Caused by: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.lang.String' to required type 'com.test.Company' for property 'company'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [com.test.Company] for property 'company': no matching editors or conversion strategy found
at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:485)
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:516)
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:510)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1406)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1365)

joined on
March 18,2013
Replied on April 11,2013

It looks that you have a class Company. And you want to inject company object but you are giving string value. Check whether you are providing correct value to Company data type.

Write Answer

Copyright ©2017 concretepage.com, all rights reserved |Privacy Policy | Contact Us