Failed to convert property value of type 'java.util.LinkedHashMap' to required
来源:互联网 发布:阿里云幕布原图下载 编辑:程序博客网 时间:2024/05/17 19:58
Failed to convert property value of type 'java.util.LinkedHashMap' to required
- 博客分类:
- 异常
Springmap
- Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'payCallbackHandler' defined in URL [file:/E:/workspace/pay-biz/webapp/WEB-INF/classes/applicationContext_pay.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMisma
- tchException: Failed to convert property value of type 'java.util.LinkedHashMap' to required type 'java.util.Map' for property 'payMerIdParamMap'; nested exception is java.lang.NumberFormatException: For input string: "yeepay"
- at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
- at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
- at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
- at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
- at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
- at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
- at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:269)
- at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
- at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:876)
- at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:818)
- at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:735)
- at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:478)
- ... 32 more
先检查类中Map需要注入的类型有没有写错,spring的注入会自动检测类型,自动匹配map的泛型定义类型.
我出错的原因是自己类型写错了。下面的方法用不上。
解决办法,指定map类型,默认LinkedHashMap
- <bean id="beanName" class="package.xxx.xxx.Class">
- <property name="data">
- <bean class="java.util.HashMap">
- <constructor-arg>
- <map>
- ....................
- </map>
- </constructor-arg>
- </bean>
- </property>
- </bean>
来源:http://hi.baidu.com/songxy888/item/768315ff1e60c41fe2e3bdf5
0 0
- Failed to convert property value of type 'java.util.LinkedHashMap' to required
- Failed to convert property value of type 'java.util.Properties' to required type 'org.springframewor
- Failed to convert property value of type [java.lang.String] to required type [java.util.Date] for pr
- Failed to convert property value of type [java.lang.String] to required type [java.util.Date] for pr
- Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date' for pr
- 关于springMVC中:Failed to convert property value of type 'java.lang.String' to required type 'java.util
- Failed to convert property value of type [java.lang.String] to required type [boolean] for property
- Failed to convert property value of type 'java.lang.String' to required type 'int' for property
- 解决:Failed to convert value of type 'java.lang.String' to required type 'java.util.Date';
- springmvc-- Failed to convert property value of type 'java.lang.String' to required type
- Failed to convert property value of type [java.lang.String] to required type [int]
- Failed to convert property value of type [$Proxy13] to required type
- spring 事务异常Failed to convert property value of type [$Proxy12] to required type
- spring Failed to convert property value of type [$Proxy10] to required type
- SSH 项目异常:Failed to convert property value of type [$Proxy13] to required type
- spring Failed to convert property value of type 'java.lang.String' to required type 'int' for proper
- spring mvc 数据绑定报错 Failed to convert property value of type 'java.lang.String' to required type 'int'
- Cannot convert value of type [java.lang.String] to required type [java.util.Date] for property 'xxx'
- 解决ViewPager嵌套,滑动冲突
- 手机的一些小技巧
- Android学习——Menu
- iframe 自适应高度
- hadoop与hbase伪分布式的基本配制文件设置
- Failed to convert property value of type 'java.util.LinkedHashMap' to required
- Failed to execute 'texImage2D' on 'WebGLRenderingContext
- AViewPager——ViewPager的代替品
- 解决ScrollView和GridView滑动冲突的问题
- C++很不错的网址
- 面试基础整理(一)---Java中==和equals的区别
- 如何搭建网站
- 远程访问jupyter notebook
- poj2395 Out of Hay (prim算法)