当前位置:首页 > 开发 > 数据库 > 正文

Parameter Maps collection does not contain value for java.util.Map

发表于: 2014-09-20   作者:zwllxs   来源:转载   浏览:
摘要: 一次写mybatis sql,一问题困惑了好久,如下: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.IncompleteElementException: Could not find parameter map java.util.Map at or
一次写mybatis sql,一问题困惑了好久,如下:

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.IncompleteElementException: Could not find parameter map java.util.Map
	at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73)
	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:364)
	at com.sun.proxy.$Proxy8.selectList(Unknown Source)
	at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:194)
	at com.zwlsoft.service.dao4.MyIbatisBaseDao.selectList(MyIbatisBaseDao.java:285)
	at com.zwlsoft.test.DaoTest.test3(DaoTest.java:84)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.apache.ibatis.builder.IncompleteElementException: Could not find parameter map java.util.Map
	at org.apache.ibatis.builder.MapperBuilderAssistant.setStatementParameterMap(MapperBuilderAssistant.java:319)
	at org.apache.ibatis.builder.MapperBuilderAssistant.addMappedStatement(MapperBuilderAssistant.java:283)
	at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseStatementNode(XMLStatementBuilder.java:107)
	at org.apache.ibatis.session.Configuration.buildAllStatements(Configuration.java:698)
	at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:629)
	at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:624)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:107)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:102)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:354)
	... 28 more
Caused by: java.lang.IllegalArgumentException: Parameter Maps collection does not contain value for java.util.Map
	at org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:797)
	at org.apache.ibatis.session.Configuration.getParameterMap(Configuration.java:570)
	at org.apache.ibatis.builder.MapperBuilderAssistant.setStatementParameterMap(MapperBuilderAssistant.java:317)
	... 40 more


当时就震惊了,在ibatis和mybatis中,一直是这么写过来的,今天偏偏就报错最,然后仔细一看,原来我把parameterType写成parameterMap了。,在mybatis中,parameterMap已经取消了,哎,取消了的话,你配置文件中的提示是不是也得去掉,不然误导人啊

Parameter Maps collection does not contain value for java.util.Map

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

编辑推荐
[根源] mybatis错误 Mapped Statements collection does not contain value for (2012-07-27 18:05:
升级了Xcode7,之前加入的第三方库,在iPhone4上编译报错,错误如下: does not contain bitcode. Y
*** does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_
升级了Xcode7,之前加入的第三方库,在iPhone4上编译报错,错误如下: does not contain bitcode. Y
作者:pocky 今天用eclipse,当打算run一个带有main函数的class时,出现editor does not contain a
在使用Flex开发时遇到的一个问题,项目报错:Server SDK: Directory does not contain a Flex SDK.
Does not contain a valid host:port authority: file:/// 在进行 伪分布式Hadoop配置时出现信息如下
Does not contain a valid host:port authority: file:/// 在进行 伪分布式Hadoop配置时出现信息如下
今天用eclipse,当打算run一个带有main函数的class时,出现editor does not contain a main type的
在使用Flex开发时遇到的一个问题,项目报错:Server SDK: Directory does not contain a Flex SDK.
版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号