java.lang.IllegalArgumentException: Parameter Maps collection does not contain value for

不小心又犯这种错,记录下避免下次再犯错!

本来正常的mybatis程序:突然报这个错java.lang.IllegalArgumentException: Parameter Maps collection does not contain value for而且报错

总结下原因:mapper.xml 中IDE提示有parameterMap属性而这个属性已经早废弃了且应该使用parameterType,如果不小心写成parameterMap那就中招了!

阅读更多

ssm框架错误Parameter Maps collection does not contain value for java.lang.String

09-20

[size=24px]这是xml里的sql语句rn rn rn select * from where num = #numrn rn[color=#000080]提示的错误[/color]rn[color=#FF0000]java.lang.IllegalArgumentException[/color]: [u]Parameter Maps collection does not contain value for java.lang.String[/u]rn at org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:768)rn at org.apache.ibatis.session.Configuration.getParameterMap(Configuration.java:542)rn at org.apache.ibatis.builder.MapperBuilderAssistant.setStatementParameterMap(MapperBuilderAssistant.java:336)rn at org.apache.ibatis.builder.MapperBuilderAssistant.addMappedStatement(MapperBuilderAssistant.java:302)rn at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseStatementNode(XMLStatementBuilder.java:111)rn at org.apache.ibatis.session.Configuration.buildAllStatements(Configuration.java:675)rn at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:601)rn at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:596)rn at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:103)rn at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:98)rn at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:62)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:606)rn at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:354)rn at com.sun.proxy.$Proxy17.selectOne(Unknown Source)rn at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:159)rn at pers.youtoo.dao.impl.DaoImpl.selectOne(DaoImpl.java:36)rn at pers.youtoo.service.impl.UserServiceImpl.selectUserByNum(UserServiceImpl.java:44)rn at pers.youtoo.controller.LoginController.login(LoginController.java:61)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:606)rn at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215)rn at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)rn at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)rn at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749)rn at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689)rn at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)rn at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938)rn at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870)rn at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)rn at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:863)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)rn at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)rn at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)rn at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)rn at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:442)rn at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1082)rn at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:623)rn at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)rn at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)rn at java.lang.Thread.run(Thread.java:744)rn[/size][color=#000000][/color]

没有更多推荐了,返回首页