Failed to convert property value of type [java.lang.String] to Required type [Boolean]

Source: Internet
Author: User

The Config.property file configuration is

Closesolrupdate=true;

class file

public class Goodsearchindexhelper {

Private Boolean colsesolrupdate;

public Boolean isclosesolrupdate () {
return closesolrupdate;
}

public void Setclosesolrupdate (Boolean closesolrupdate) {
This.closesolrupdate = closesolrupdate;
}

}


Configuration file Jms-handler-good.xml


<bean id= "Searchindexhelper" class= "Com.xiu.search.good.GoodSearchIndexHelper" init-method= "init" >
<constructor-arg>
<ref bean= "JdbcTemplate"/>
</constructor-arg>
<property name= "StoreID" value= "${storeid}"/>
<property name= "Solrserverurl" value= "${solrserverurl}" ></property>
<property name= "Closesolrupdate" value= "Colsesolrupdate" ></property>
</bean>

Report the following anomalies


Workaround: Change the Boolean type to String type

Private Boolean colsesolrupdate;---> Private String closesolrupdate;



Exception in thread "main" Org.springframework.beans.factory.BeanCreationException:Error creating beans with Name ' Messagehandlerfactory ' defined in URL [File:/e:/xop-platform-workspace/jmsserverproject/target/classes/service_ Config.xml]: Invocation of Init method failed; Nested exception is org.springframework.beans.factory.BeanCreationException:Error creating beans with Name ' Com.xiu.search.good.integration.allgoodspricechangedmessagehandlerimpl4test#0 ' defined in file [E:\ Xop-platform-workspace\jmsserverproject\target\test-classes\jmsconfig\jms-handler-good.xml]: Cannot Resolve Reference to Bean ' largenumberofgoodsindexhelper4test ' while the setting bean property ' Largenumberofgoodsindexhelper '; Nested exception is org.springframework.beans.factory.BeanCreationException:Error creating beans with Name ' Largenumberofgoodsindexhelper4test ' defined in file [E:\xop-platform-workspace\JMSServerProject\target\ Test-classes\jmsconfig\jms-handler-good.xml]: Cannot resolve reference to bean ' SearcHindexhelper ' while setting beans property ' Searchindexhelper '; Nested exception is org.springframework.beans.factory.BeanCreationException:Error creating beans with Name ' Searchindexhelper ' defined in file [E:\xop-platform-workspace\GoodSearchProject\target\classes\jmsconfig\ Jms-handler-good.xml]: Initialization of Bean failed; Nested exception is org.springframework.beans.TypeMismatchException:Failed to convert property value of type [Java.lang. String] to Required type [Boolean] for property ' Closesolrupdate '; Nested exception is java.lang.IllegalArgumentException:Invalid boolean value [Colsesolrupdate]
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean ( abstractautowirecapablebeanfactory.java:1338)
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean ( abstractautowirecapablebeanfactory.java:473)
At Org.springframework.beans.factory.support.abstractautowirecapablebeanfactory$1.run ( abstractautowirecapablebeanfactory.java:409)
At Java.security.AccessController.doPrivileged (Native method)
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean ( abstractautowirecapablebeanfactory.java:380)
At Org.springframework.beans.factory.support.abstractbeanfactory$1.getobject (abstractbeanfactory.java:264)
At Org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton ( defaultsingletonbeanregistry.java:222)
At Org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (abstractbeanfactory.java:261)
At Org.springframework.beans.factory.support.AbstractBeanFactory.getBean (abstractbeanfactory.java:185)
At Org.springframework.beans.factory.support.AbstractBeanFactory.getBean (abstractbeanfactory.java:164)
At Org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons ( defaultlistablebeanfactory.java:429)
At Org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization ( abstractapplicationcontext.java:728)
At Org.springframework.context.support.AbstractApplicationContext.refresh (abstractapplicationcontext.java:380)
At Com.xiu.search.jms.JMSServer.start (jmsserver.java:96)
At Com.xiu.search.jms.JMSServer.main (jmsserver.java:51)
At Teststarter.main (teststarter.java:12)
caused by:org.springframework.beans.factory.BeanCreationException:Error creating bean with Name ' Com.xiu.search.good.integration.allgoodspricechangedmessagehandlerimpl4test#0 ' defined in file [E:\ Xop-platform-workspace\jmsserverproject\target\test-classes\jmsconfig\jms-handler-good.xml]: Cannot Resolve Reference to Bean ' largenumberofgoodsindexhelper4test ' while the setting bean property ' Largenumberofgoodsindexhelper '; Nested exception is org.springframework.beans.factory.BeanCreationException:Error creating beans with Name ' Largenumberofgoodsindexhelper4test ' defined in file [E:\xop-platform-workspace\JMSServerProject\target\ Test-classes\jmsconfig\jms-handler-good.xml]: Cannot resolve reference to bean ' searchindexhelper ' while setting bean Property ' Searchindexhelper '; Nested exception is org.springframework.beans.factory.BeanCreationException:Error creating beans with Name ' Searchindexhelper ' defined in file [E:\xop-platform-workspace\GoodSearchProject\target\classes\jmsconfig\jms-hAndler-good.xml]: Initialization of Bean failed; Nested exception is org.springframework.beans.TypeMismatchException:Failed to convert property value of type [Java.lang. String] to Required type [Boolean] for property ' Closesolrupdate '; Nested exception is java.lang.IllegalArgumentException:Invalid boolean value [Colsesolrupdate]
At Org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference ( beandefinitionvalueresolver.java:275)
At Org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary ( BEANDEFINITIONVALUERESOLVER.JAVA:104)
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues ( abstractautowirecapablebeanfactory.java:1245)
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean ( abstractautowirecapablebeanfactory.java:1010)
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean ( abstractautowirecapablebeanfactory.java:472)
At Org.springframework.beans.factory.support.abstractautowirecapablebeanfactory$1.run ( abstractautowirecapablebeanfactory.java:409)
At Java.security.AccessController.doPrivileged (Native method)
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean ( abstractautowirecapablebeanfactory.java:380)
At Org.springframework.beans.factory.support.abstractbeanfactory$1.getobject (abstractbeanfactory.java:264)
At Org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton ( defaultsingletonbeanregistry.java:222)
At Org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (abstractbeanfactory.java:261)
At Org.springframework.beans.factory.support.AbstractBeanFactory.getBean (abstractbeanfactory.java:185)
At Org.springframework.beans.factory.support.AbstractBeanFactory.getBean (abstractbeanfactory.java:164)
At Org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons ( defaultlistablebeanfactory.java:429)
At Org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization ( abstractapplicationcontext.java:728)
At Org.springframework.context.support.AbstractApplicationContext.refresh (abstractapplicationcontext.java:380)
At Com.xiu.search.jms.DefaultMessageHandlerFactoryImpl.afterPropertiesSet (Defaultmessagehandlerfactoryimpl.java : 89)
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods ( abstractautowirecapablebeanfactory.java:1369)
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean ( abstractautowirecapablebeanfactory.java:1335)
... More
caused by:org.springframework.beans.factory.BeanCreationException:Error creating bean with Name ' Largenumberofgoodsindexhelper4test ' defined in file [E:\xop-platform-workspace\JMSServerProject\target\ Test-classes\jmsconfig\jms-handler-good.xml]: Cannot resolve reference to bean ' searchindexhelper ' while setting bean Property ' Searchindexhelper '; Nested exception is org.springframework.beans.factory.BeanCreationException:Error creating beans with Name ' Searchindexhelper ' defined in file [E:\xop-platform-workspace\GoodSearchProject\target\classes\jmsconfig\ Jms-handler-good.xml]: Initialization of Bean failed; Nested exception is org.springframework.beans.TypeMismatchException:Failed to convert property value of type [Java.lang. String] to Required type [Boolean] for property ' Closesolrupdate '; Nested exception is java.lang.IllegalArgumentException:Invalid boolean value [Colsesolrupdate]
At Org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference ( beandefinitionvalueresolver.java:275)
At Org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary ( BEANDEFINITIONVALUERESOLVER.JAVA:104)
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues ( abstractautowirecapablebeanfactory.java:1245)
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean ( abstractautowirecapablebeanfactory.java:1010)
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean ( abstractautowirecapablebeanfactory.java:472)
At Org.springframework.beans.factory.support.abstractautowirecapablebeanfactory$1.run ( abstractautowirecapablebeanfactory.java:409)
At Java.security.AccessController.doPrivileged (Native method)
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean ( abstractautowirecapablebeanfactory.java:380)
At Org.springframework.beans.factory.support.abstractbeanfactory$1.getobject (abstractbeanfactory.java:264)
At Org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton ( defaultsingletonbeanregistry.java:222)
At Org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (abstractbeanfactory.java:261)
At Org.springframework.beans.factory.support.AbstractBeanFactory.getBean (abstractbeanfactory.java:185)
At Org.springframework.beans.factory.support.AbstractBeanFactory.getBean (abstractbeanfactory.java:164)
At Org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference ( beandefinitionvalueresolver.java:269)
... More
caused by:org.springframework.beans.factory.BeanCreationException:Error creating bean with Name ' Searchindexhelper ' defined in file [E:\xop-platform-workspace\GoodSearchProject\target\classes\jmsconfig\jms-handler-good.xml]: Initialization of Bean failed; Nested exception is org.springframework.beans.TypeMismatchException:Failed to convert property value of type [Java.lang. String] to Required type [Boolean] for property ' Closesolrupdate '; Nested exception is java.lang.IllegalArgumentException:Invalid boolean value [Colsesolrupdate]
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean ( abstractautowirecapablebeanfactory.java:480)
At Org.springframework.beans.factory.support.abstractautowirecapablebeanfactory$1.run ( abstractautowirecapablebeanfactory.java:409)
At Java.security.AccessController.doPrivileged (Native method)
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean ( abstractautowirecapablebeanfactory.java:380)
At Org.springframework.beans.factory.support.abstractbeanfactory$1.getobject (abstractbeanfactory.java:264)
At Org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton ( defaultsingletonbeanregistry.java:222)
At Org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (abstractbeanfactory.java:261)
At Org.springframework.beans.factory.support.AbstractBeanFactory.getBean (abstractbeanfactory.java:185)
At Org.springframework.beans.factory.support.AbstractBeanFactory.getBean (abstractbeanfactory.java:164)
At Org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference ( beandefinitionvalueresolver.java:269)
... More
caused By:org.springframework.beans.TypeMismatchException:Failed to convert property value of type [java.lang.String] t o Required Type [Boolean] for property ' Closesolrupdate '; Nested exception is java.lang.IllegalArgumentException:Invalid boolean value [Colsesolrupdate]
At Org.springframework.beans.BeanWrapperImpl.convertForProperty (beanwrapperimpl.java:391)
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty ( abstractautowirecapablebeanfactory.java:1289)
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues ( ABSTRACTAUTOWIRECAPABLEBEANFACTORY.JAVA:1250)
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean ( abstractautowirecapablebeanfactory.java:1010)
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean ( abstractautowirecapablebeanfactory.java:472)
... More
caused By:java.lang.IllegalArgumentException:Invalid boolean value [Colsesolrupdate]
At Org.springframework.beans.propertyeditors.CustomBooleanEditor.setAsText (custombooleaneditor.java:123)
At Org.springframework.beans.TypeConverterDelegate.doConvertTextValue (typeconverterdelegate.java:382)
At Org.springframework.beans.TypeConverterDelegate.doConvertValue (typeconverterdelegate.java:358)
At Org.springframework.beans.TypeConverterDelegate.convertIfNecessary (typeconverterdelegate.java:173)
At Org.springframework.beans.TypeConverterDelegate.convertIfNecessary (typeconverterdelegate.java:138)
At Org.springframework.beans.BeanWrapperImpl.convertForProperty (beanwrapperimpl.java:386)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.