mybatis报错(三)报错Result Maps collection does not contain value for java.lang.Integer解决方法


转自:https://blog.csdn.net/zengdeqing2012/article/details/50978682 
1
[WARN ] 2016-03-25 13:03:23,955 - org.springframework.remoting.support.RemoteInvocationTraceInterceptor -53288 [RMI TCP Connection(5)-192.168.1.140] - Processing of RmiServiceExporter remote call resulted in fatal exception: com.rz.rpc.service.BorrowRmiService.getBorrowTenderlist 2 java.lang.RuntimeException: org.apache.ibatis.builder.IncompleteElementException: Could not find result map java.lang.Integer 3 org.apache.ibatis.builder.IncompleteElementException: Could not find result map java.lang.Integer 4 at org.apache.ibatis.builder.MapperBuilderAssistant.setStatementResultMap(MapperBuilderAssistant.java:354) 5 at org.apache.ibatis.builder.MapperBuilderAssistant.addMappedStatement(MapperBuilderAssistant.java:292) 6 at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseStatementNode(XMLStatementBuilder.java:113) 7 at org.apache.ibatis.session.Configuration.buildAllStatements(Configuration.java:579) 8 at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:505) 9 at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:500) 10 at org.apache.ibatis.binding.MapperMethod.setupCommandType(MapperMethod.java:240) 11 at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:71) 12 at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:39) 13 at com.sun.proxy.$Proxy33.findPageCount(Unknown Source) 14 at com.rz.common.service.borrow.BorrowService.getBorrowTenderlist(BorrowService.java:468) 15 at com.rz.rpc.service.impl.BorrowRmiServiceImpl.getBorrowTenderlist(BorrowRmiServiceImpl.java:70) 16 at com.alibaba.dubbo.common.bytecode.Wrapper17.invokeMethod(Wrapper17.java) 17 at com.alibaba.dubbo.rpc.proxy.javassist.JavassistProxyFactory$1.doInvoke(JavassistProxyFactory.java:46) 18 at com.alibaba.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:72) 19 at com.alibaba.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:53) 20 at com.alibaba.dubbo.rpc.filter.ExceptionFilter.invoke(ExceptionFilter.java:64) 21 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 22 at com.alibaba.dubbo.rpc.filter.TimeoutFilter.invoke(TimeoutFilter.java:42) 23 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 24 at com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:75) 25 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 26 at com.alibaba.dubbo.rpc.protocol.dubbo.filter.TraceFilter.invoke(TraceFilter.java:78) 27 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 28 at com.alibaba.dubbo.rpc.filter.ContextFilter.invoke(ContextFilter.java:60) 29 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 30 at com.alibaba.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:112) 31 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 32 at com.alibaba.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:38) 33 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 34 at com.alibaba.dubbo.rpc.filter.EchoFilter.invoke(EchoFilter.java:38) 35 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 36 at com.alibaba.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:52) 37 at com.alibaba.dubbo.common.bytecode.proxy8.getBorrowTenderlist(proxy8.java) 38 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 39 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 40 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 41 at java.lang.reflect.Method.invoke(Method.java:606) 42 at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318) 43 at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) 44 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) 45 at org.springframework.remoting.support.RemoteInvocationTraceInterceptor.invoke(RemoteInvocationTraceInterceptor.java:77) 46 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) 47 at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) 48 at com.sun.proxy.$Proxy55.getBorrowTenderlist(Unknown Source) 49 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 50 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 51 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 52 at java.lang.reflect.Method.invoke(Method.java:606) 53 at org.springframework.remoting.support.RemoteInvocation.invoke(RemoteInvocation.java:205) 54 at org.springframework.remoting.support.DefaultRemoteInvocationExecutor.invoke(DefaultRemoteInvocationExecutor.java:38) 55 at org.springframework.remoting.support.RemoteInvocationBasedExporter.invoke(RemoteInvocationBasedExporter.java:78) 56 at org.springframework.remoting.rmi.RmiBasedExporter.invoke(RmiBasedExporter.java:73) 57 at org.springframework.remoting.rmi.RmiInvocationWrapper.invoke(RmiInvocationWrapper.java:72) 58 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 59 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 60 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 61 at java.lang.reflect.Method.invoke(Method.java:606) 62 at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322) 63 at sun.rmi.transport.Transport$2.run(Transport.java:202) 64 at sun.rmi.transport.Transport$2.run(Transport.java:199) 65 at java.security.AccessController.doPrivileged(Native Method) 66 at sun.rmi.transport.Transport.serviceCall(Transport.java:198) 67 at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:567) 68 at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828) 69 at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.access$400(TCPTransport.java:619) 70 at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$1.run(TCPTransport.java:684) 71 at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$1.run(TCPTransport.java:681) 72 at java.security.AccessController.doPrivileged(Native Method) 73 at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:681) 74 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 75 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 76 at java.lang.Thread.run(Thread.java:745) 77 Caused by: java.lang.IllegalArgumentException: Result Maps collection does not contain value for java.lang.Integer 78 at org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:672) 79 at org.apache.ibatis.session.Configuration.getResultMap(Configuration.java:434) 80 at org.apache.ibatis.builder.MapperBuilderAssistant.setStatementResultMap(MapperBuilderAssistant.java:352) 81 ... 72 more 82 83 at com.alibaba.dubbo.rpc.filter.ExceptionFilter.invoke(ExceptionFilter.java:108) 84 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 85 at com.alibaba.dubbo.rpc.filter.TimeoutFilter.invoke(TimeoutFilter.java:42) 86 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 87 at com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:75) 88 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 89 at com.alibaba.dubbo.rpc.protocol.dubbo.filter.TraceFilter.invoke(TraceFilter.java:78) 90 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 91 at com.alibaba.dubbo.rpc.filter.ContextFilter.invoke(ContextFilter.java:60) 92 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 93 at com.alibaba.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:112) 94 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 95 at com.alibaba.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:38) 96 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 97 at com.alibaba.dubbo.rpc.filter.EchoFilter.invoke(EchoFilter.java:38) 98 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 99 at com.alibaba.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:52) 100 at com.alibaba.dubbo.common.bytecode.proxy8.getBorrowTenderlist(proxy8.java) 101 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 102 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 103 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 104 at java.lang.reflect.Method.invoke(Method.java:606) 105 at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318) 106 at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) 107 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) 108 at org.springframework.remoting.support.RemoteInvocationTraceInterceptor.invoke(RemoteInvocationTraceInterceptor.java:77) 109 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) 110 at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) 111 at com.sun.proxy.$Proxy55.getBorrowTenderlist(Unknown Source) 112 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 113 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 114 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 115 at java.lang.reflect.Method.invoke(Method.java:606) 116 at org.springframework.remoting.support.RemoteInvocation.invoke(RemoteInvocation.java:205) 117 at org.springframework.remoting.support.DefaultRemoteInvocationExecutor.invoke(DefaultRemoteInvocationExecutor.java:38) 118 at org.springframework.remoting.support.RemoteInvocationBasedExporter.invoke(RemoteInvocationBasedExporter.java:78) 119 at org.springframework.remoting.rmi.RmiBasedExporter.invoke(RmiBasedExporter.java:73) 120 at org.springframework.remoting.rmi.RmiInvocationWrapper.invoke(RmiInvocationWrapper.java:72) 121 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 122 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 123 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 124 at java.lang.reflect.Method.invoke(Method.java:606) 125 at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322) 126 at sun.rmi.transport.Transport$2.run(Transport.java:202) 127 at sun.rmi.transport.Transport$2.run(Transport.java:199) 128 at java.security.AccessController.doPrivileged(Native Method) 129 at sun.rmi.transport.Transport.serviceCall(Transport.java:198) 130 at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:567) 131 at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828) 132 at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.access$400(TCPTransport.java:619) 133 at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$1.run(TCPTransport.java:684) 134 at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$1.run(TCPTransport.java:681) 135 at java.security.AccessController.doPrivileged(Native Method) 136 at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:681) 137 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 138 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 139 at java.lang.Thread.run(Thread.java:745)

 

 

解决办法:

1.检查mybatis的xml配置

2.在某处肯定有配错了的,如"resultMap" -->"resultType"

 1     <select id="getNumDayMoney" resultMap="java.lang.Integer" parameterType="java.lang.Integer">  
 2             <![CDATA[ 
 3                 select sum(money) from dw_account_recharge where user_id = #{userId} 
 4                 AND addtime < UNIX_TIMESTAMP( 
 5                     date_sub(curdate(), INTERVAL - 1 DAY) 
 6                 ) 
 7                 AND addtime > UNIX_TIMESTAMP( 
 8                     date_sub(curdate(), INTERVAL 1 DAY) 
 9                 )  
10             ]]>  
11         </select>  

修改为:

 1 <select id="getNumDayMoney" resultType="java.lang.Integer" parameterType="java.lang.Integer">  
 2         <![CDATA[ 
 3             select sum(money) from dw_account_recharge where user_id = #{userId} 
 4             AND addtime < UNIX_TIMESTAMP( 
 5                 date_sub(curdate(), INTERVAL - 1 DAY) 
 6             ) 
 7             AND addtime > UNIX_TIMESTAMP( 
 8                 date_sub(curdate(), INTERVAL 1 DAY) 
 9             )  
10         ]]>  
11     </select>

 

打赏

免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2021 CODEPRJ.COM