Failed to convert property value of type [java.lang.String] to required type [bo

论坛 期权论坛 编程之家     
选择匿名的用户   2021-6-2 17:47   687   0

config.property文件配置的为

closeSolrUpdate=true;

类文件

public class GoodSearchIndexHelper {

private boolean colseSolrUpdate;

public boolean isCloseSolrUpdate() {
return closeSolrUpdate;
}

public void setCloseSolrUpdate(boolean closeSolrUpdate) {
this.closeSolrUpdate = closeSolrUpdate;
}

}


配置文件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>

报下面异常


解决方法:把boolean的类型改为String类型

private boolean colseSolrUpdate;---> private String closeSolrUpdate;



Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean 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 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 setting bean property 'largeNumberOfGoodsIndexHelper'; nested exception is 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 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.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 setting bean property 'largeNumberOfGoodsIndexHelper'; nested exception is org.springframework.beans.factory.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'#B7&&v&V&GVFF7W7FFWD5FWB7W7FFf#2#B7&&v&VGT6'FW$FVvFR6'EFWEfRGT6'FW$FVvFRf3"#B7&&v&VGT6'FW$FVvFR6'EfRGT6'FW$FVvFRf3S#B7&&v&VGT6'FW$FVvFR'DdW76'GT6'FW$FVvFRfs2#B7&&v&VGT6'FW$FVvFR'DdW76'GT6'FW$FVvFRf3#B7&&v&V&VW$6'DfG&VW$f3b7'##

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP