这几天使用speing+mybatis的时候遇到一个奇葩的问题,解决方案也是很令人陶醉
eclipse的报错:
严重: Servlet.service() for servlet [XXXXX] in context with path [/XXXXX] threw exception [Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter '2' not found. Available parameters are [arg2, arg1, arg0, param3, param1, param2]] with root cause
org.apache.ibatis.binding.BindingException: Parameter '2' not found. Available parameters are [arg2, arg1, arg0, param3, param1, param2]
版本:spring-4.2.4 、mybatis-3.4.2.jar、mybatis-spring-1.3.1.jar、jre7
这个版本的搭配是没有任何问题的,因为项目在公司同事电脑和服务器上都可以运行,唯独我的机器上不可以。
我在经历了各种挣扎之后,做了如下操作,恢复了正常。
在eclipse里,对着项目点右键,打开Java Build Path,将JRE移除,然后再添加进来。
就完美解决,运行没有毛病了。