spring启动报错:Cannot convert value of type [org.apache.commons.collections.map.LinkedMap] to required t
来源:互联网 发布:淘宝客app软件 编辑:程序博客网 时间:2024/06/09 22:49
本地eclipse启动java程序,一切正常。但bat脚本启动java程序,发现报错如下:
Caused by: java.lang.IllegalArgumentException: Cannot convert value of type [org.apache.commons.collections.map.LinkedMap] to required type
[java.util.HashMap] for property 'actionSet': no matching editors or conversion strategy found
后来参考这篇文章:http://blog.csdn.net/evane1890/article/details/5185456
大致怀疑是jdk版本的问题,仔细查看启动后的日志:
可以看到path和class环境变量的值。path变量加载顺序是先加载前面的,如果找到,不继续往下寻找。所以java命令执行时是用的jdk1.8下的。
而系统使用spring2.0,jdk1.8和spring2.0肯定存在版本冲突的问题。
修改bat脚本如下:
set JAVA_HOME=D:\jdk16x64
set path=.;%JAVA_HOME%;%JAVA_HOME%\bin
set classpath=.;%JAVA_HOME%\lib;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\jre\lib\rt.jar;
pause
set classpath=%classpath%;./classes;
set classpath=%classpath%;./lib/others/spring2.06.jar;
set classpath=%classpath%;./lib/log4j/log4j-1.2.14.jar;
set classpath=%classpath%;./lib/quartz/quartz-all-1.6.0.jar;
set classpath=%classpath%;./lib/mina/mina-core-2.0.0-RC1.jar;
set classpath=%classpath%;./lib/db2/db2java.jar;
set classpath=%classpath%;./lib/db2/db2jcc_license_cu.jar;
set classpath=%classpath%;./lib/db2/db2jcc.jar;
set classpath=%classpath%;./lib/commons/commons-dbcp-1.4.jar;
set classpath=%classpath%;./lib/commons/commons-logging-1.0.4.jar;
set classpath=%classpath%;./lib/commons/commons-collections-3.2.2.jar;
set classpath=%classpath%;./lib/commons/commons-pool-1.5.6.jar;
set classpath=%classpath%;./lib/commons/commons-codec-1.3.jar;
set classpath=%classpath%;./lib/commons/commons-httpclient-3.0.jar;
set classpath=%classpath%;./lib/commons/commons-discovery-0.2.jar;
set classpath=%classpath%;./lib/commons/commons-beanutils-1.9.2.jar;
set classpath=%classpath%;./lib/commons/commons-io-2.0.jar;
set classpath=%classpath%;./lib/commons/commons-configuration2-2.0-beta2.jar;
set classpath=%classpath%;./lib/commons/commons-lang3-3.4.jar;
set classpath=%classpath%;./lib/slf4j/slf4j-api-1.6.1.jar;
set classpath=%classpath%;./lib/slf4j/slf4j-nop-1.6.1.jar;
set classpath=%classpath%;./lib/slf4j/slf4j-simple-1.6.1.jar;
set classpath=%classpath%;./lib/antlr/antlr-2.7.6.jar;
set classpath=%classpath%;./lib/antlr/antlr.license.txt;
set classpath=%classpath%;./lib/others/bcprov-jdk14-135.jar;
set classpath=%classpath%;./lib/others/bcprov-jdk16-146.jar;
set classpath=%classpath%;./lib/others/wsdl4j-1.5.1.jar;
set classpath=%classpath%;./lib/others/jaxrpc.jar;
set classpath=%classpath%;./lib/others/dom4j-1.6.1.jar;
set classpath=%classpath%;./lib/others/hibernate3.jar;
set classpath=%classpath%;./lib/others/javassist-3.9.0.GA.jar;
set classpath=%classpath%;./lib/others/jta-1.1.jar;
set classpath=%classpath%;./lib/others/spring2.06.jar;
set classpath=%classpath%;./lib/others/xmap.jar;
set classpath=%classpath%;./lib/cglib/cglib-nodep-2.1_3.jar;
set classpath=%classpath%;./lib/others/fu-framework.jar;
set classpath=%classpath%;./lib/others/axis-ant.jar;
set classpath=%classpath%;./lib/others/axis.jar;
set classpath=%classpath%;./lib/others/mail.jar;
set classpath=%classpath%;./lib/others/activation.jar;
set classpath=%classpath%;./lib/others/notify.jar;
set classpath=%classpath%;./lib/others/ssn-test.jar;
set classpath=%classpath%;./lib/others/DSign.jar;
set classpath=%classpath%;./lib/others/gateway-security-1.0.jar;
set classpath=%classpath%;./lib/others/pkitool20.jar;
set classpath=%classpath%;./lib/others/keyLoader.jar;
set classpath=%classpath%;./lib/poi/xmlbeans-2.3.0.jar;
set classpath=%classpath%;./lib/poi/poi-ooxml-schemas-3.7-20101029.jar;
set classpath=%classpath%;./lib/poi/poi-ooxml-3.7-20101029.jar;
set classpath=%classpath%;./lib/poi/poi-scratchpad-3.7-20101029.jar;
set classpath=%classpath%;./lib/poi/poi-3.7-20101029.jar;
set classpath=%classpath%;./lib/others/fastjson-1.2.29.jar;
set classpath=%classpath%;./lib/others/rutSignChg2.11.jar;
java -Dcps -Xms512m -Xmx512m -XX:-UseGCOverheadLimit -XX:+PrintGC -XX:+PrintGCDetails -Xloggc:../logs/gc.log -XX:+PrintGCDateStamps com.test.cps.StartUp
运行bat脚本,可以正常启动,至此问题已解决。
- spring启动报错:Cannot convert value of type [org.apache.commons.collections.map.LinkedMap] to required t
- 三、Failed to convert property value of type [org.apache.commons.dbcp.BasicDataSource] to required
- Failed to convert property value of type [org.apache.commons.dbcp.BasicDataSource] to required
- mybatis 5.0 报错 Cannot convert value of type ‘com.github.pagehelper.PageHelper’ to required type ‘org
- 在用StrutsMenu时,报异常java.lang.NoClassDefFoundError: org/apache/commons/collections/map/LinkedMap
- javax.servlet.UnavailableException: org/apache/commons/collections/map/LinkedMap
- Spring: Error Cannot convert value of type [$Proxy...] to required type
- Spring-aop: Error Cannot convert value of type [$Proxy...] to required type
- 配置Spring Cannot convert value of type [java.lang.String] to required type [javax.sql.DataSource]
- spring mvc 数据绑定报错 Failed to convert property value of type 'java.lang.String' to required type 'int'
- Failed to convert value of type 'java.lang.String' to required type 'org.springframework.web.multipa
- Failed to convert property value of type 'java.util.Properties' to required type 'org.springframewor
- java.lang.IllegalArgumentException: Cannot convert value of type [] to required type [] for property
- java.lang.IllegalArgumentException: Cannot convert value of type [] to required type [] for propert
- spring 事务异常Failed to convert property value of type [$Proxy12] to required type
- spring Failed to convert property value of type [$Proxy10] to required type
- spring和mina2集成报错Cannot convert value of type ..for property 'customEditors..PropertyEditor.
- Cannot convert value of type [java.lang.String] to required type [javax.sql.DataSource] for property 'dataSource': no matching e
- Python 列表(List)
- 单向链表的Python实现
- 精通比特币(读后总结)
- arcgis for android 和 mapbox android
- Android 热修复Tinker 在项目中的使用
- spring启动报错:Cannot convert value of type [org.apache.commons.collections.map.LinkedMap] to required t
- android项目bug收集
- 解决 Source Insight 4.0从 Keil uVision 5 创建工程乱码问题
- Sublime Text3 手动安装Package Control
- RGBA颜色与兼容性的半透明背景色
- java判断矩阵中是否包含某路径
- idea 快捷教程
- ”周期天王”20大预言,针针见血,看完整个人通透多了
- Java Swing 是否适合做大型项目及桌面应用?