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脚本,可以正常启动,至此问题已解决。


阅读全文
0 0
原创粉丝点击