`
一笑_奈何
  • 浏览: 68822 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

org.springframework.dao.TransientDataAccessResourceException: ### Error queryin

阅读更多
    org.apache.ibatis.builder.xml.IncompleteStatementException: Could not find parameter map com.demo.sys.mapper.ModuleMapper.moduleMap  
        at org.apache.ibatis.builder.MapperBuilderAssistant.setStatementParameterMap(MapperBuilderAssistant.java:256)  
        at org.apache.ibatis.builder.MapperBuilderAssistant.addMappedStatement(MapperBuilderAssistant.java:220)  
        at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseStatementNode(XMLStatementBuilder.java:66)  
        at org.apache.ibatis.session.Configuration.buildAllStatements(Configuration.java:497)  
        at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:434)  
        at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:428)  
        at org.apache.ibatis.binding.MapperMethod.setupCommandType(MapperMethod.java:188)  
        at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:51)  
        at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:37)  
        at $Proxy7.query(Unknown Source)  
        at com.demo.sys.service.impl.UserServiceImpl.query(UserServiceImpl.java:56)  
        at com.demo.sys.service.impl.UserServiceImpl.login(UserServiceImpl.java:81)  
        at com.demo.sys.action.UserAction.login(UserAction.java:56)  
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)  
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)  
        at java.lang.reflect.Method.invoke(Unknown Source)  
        at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:452)  
        at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:291)  
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:254)  
        at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)  
        at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)  
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)  
        at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263)  
        at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)  
        at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)  
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)  
        at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:133)  
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)  
        at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)  
        at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)  
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)  
        at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)  
        at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)  
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)  
        at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)  
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)  
        at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)  
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)  
        at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)  
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)  
        at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243)  
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)  
        at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)  
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)  
        at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)  
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)  
        at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:270)  
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)  
        at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)  
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)  
        at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)  
        at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)  
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)  
        at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)  
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)  
        at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)  
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)  
        at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:190)  
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)  
        at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)  
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)  
        at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)  
        at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:498)  
        at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:434)  
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)  
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)  
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)  
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)  
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)  
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)  
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)  
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)  
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)  
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)  
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)  
        at java.lang.Thread.run(Unknown Source)  
    Caused by: java.lang.IllegalArgumentException: Parameter Maps collection does not contain value for com.demo.sys.mapper.ModuleMapper.moduleMap  
        at org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:594)  
        at org.apache.ibatis.session.Configuration.getParameterMap(Configuration.java:390)  
        at org.apache.ibatis.builder.MapperBuilderAssistant.setStatementParameterMap(MapperBuilderAssistant.java:254)  
        ... 76 more  

发现配置:
    <resultMap type="com.demo.sys.entity.Module" id="moduleMap">  
        <id property="id" column="id" />  
        <result property="name" column="name" />  
        <result property="remark" column="remark" />  
        <result property="createDate" column="createdate" />  
        <result property="updateDate" column="updateDate" />  
        <association property="parent" column="parent_id"  
            resultMap="moduleMap" select="queryModule">  
        </association>  
        <collection property="childs" column="parent_id"  
            javaType="ArrayList" ofType="com.demo.sys.entity.Module"  
            select="queryChildList">  
        </collection>  
    </resultMap>  
    <select id="queryList" parameterMap="moduleMap" resultMap="moduleMap">  
        select * from sys_module where id =#{id}  
    </select>  

更改配置
<resultMap type="com.demo.sys.entity.Module" id="moduleMap">  
        <id property="id" column="id" />  
        <result property="name" column="name" />  
        <result property="remark" column="remark" />  
        <result property="createDate" column="createdate" />  
        <result property="updateDate" column="updateDate" />  
        <association property="parent" column="parent_id"  
            resultMap="moduleMap" select="queryModule">  
        </association>  
        <collection property="childs" column="parent_id"  
            javaType="ArrayList" ofType="com.demo.sys.entity.Module"  
            select="queryChildList">  
        </collection>  
    </resultMap>  
    <select id="queryList"  parameterType="com.demo.sys.entity.Module" resultMap="moduleMap">  
        select * from sys_module where id =#{id}  
    </select>


parameterMap="moduleMap" -------》parameterType="com.demo.sys.entity.Module"



解决了Mybatis中Parameter Maps collection does not contain value for xxx 的问题了。



查看Mybatis官方资料:

SQL映射的XML文件:parameterMap 已经废弃了,现在使用parameterType来处理。
分享到:
评论

相关推荐

    org.spring-framework-3.0.4. 所有jar

    org.springframework.aop-3.0.4.RELEASE.jar org.springframework.asm-3.0.4.RELEASE.jar org.springframework.aspects-3.0.4.RELEASE.jar org.springframework.beans-3.0.4.RELEASE.jar org.springframework....

    org.springframework.flex-1.0.3.RELEASE.jar.zip

    org.springframework.flex-1.0.3.RELEASE.jar.zip用于JAR包,org.springframework.flex-1.0.3.RELEASE.jar.zip用于JAR包org.springframework.flex-1.0.3.RELEASE.jar.zip用于JAR包org.springframework.flex-1.0.3....

    org.springframework.core.jar

    《Spring框架核心模块——org.springframework.core.jar深度解析》 在Java世界中,Spring框架以其卓越的灵活性、可扩展性和模块化设计,成为了企业级应用开发的首选。其中,`org.springframework.core.jar`是Spring...

    org.springframework.core_3.1.1.RELEASE.jar

    《Spring核心模块详解:org.springframework.core_3.1.1.RELEASE.jar》 在Java开发领域,Spring框架无疑是最重要的框架之一,它以其强大的依赖注入、面向切面编程以及丰富的功能扩展,深受开发者喜爱。其中,`org....

    org.springframework.web.servlet-3.0.1.RELEASE-A.jar

    Error creating bean with name 'org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0' defined in ServletContext resource [/WEB-INF/springMVC-servlet.xml]: Initialization of bean failed;...

    spring3.0.5 所有jar文件

    org.springframework.aop-3.0.5.RELEASE.jar org.springframework.asm-3.0.5.RELEASE.jar org.springframework.aspects-3.0.5.RELEASE.jar org.springframework.beans-3.0.5.RELEASE.jar org.springframework....

    org.springframework.web的jar包.zip

    在本篇文章中,我们将深入探讨`org.springframework.web`包中的关键概念,特别是`ServerEndpointExporter`类在WebSocket服务器端点中的作用。 首先,让我们了解`org.springframework.web`包的基本构成。这个包主要...

    org.springframework.transaction-3.1.2.RELEASE.zip

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.interceptor.TransactionInterceptor#0': Error setting property values; nested ...

    spring-mock.jar

    Classes contained in spring-mock.jar: org.springframework.mock.jndi.ExpectedLookupTemplate.class org.springframework.mock.jndi.SimpleNamingContext.class org.springframework.mock.jndi....

    org.springframework.dao.InvalidDataAccessApiUsageException

    ### 关于 `org.springframework.dao.InvalidDataAccessApiUsageException` 的深入解析 在Spring与Hibernate集成开发过程中,开发者可能会遇到各种各样的异常问题。其中一种较为常见的异常是 `org.springframework....

    spring-web-2.5.jar

    org.springframework.remoting.caucho.BurlapClientInterceptor.class org.springframework.remoting.caucho.BurlapProxyFactoryBean.class org.springframework.remoting.caucho.BurlapServiceExporter.class org....

    org.springframework.web.jar

    9. **Integration with other Spring Modules**:`org.springframework.web.jar`与Spring框架的其他模块紧密集成,如Spring Core、Spring Beans、Spring AOP等,共同构建出一个完整的应用框架。 总的来说,`org....

    解决The type org.springframework.dao.support.DaoSupport cannot be resolved.bao报错

    在开发Spring框架相关的Java应用时,可能会遇到"The type org.springframework.dao.support.DaoSupport cannot be resolved"的错误提示。这个错误通常意味着编译环境无法找到`DaoSupport`类,这是Spring DAO模块中的...

    aopalliance-1.0.jar,org.springframework.aop-3.0.0.RELEASE.jar

    aopalliance-1.0.jar,org.springframework.aop-3.0.0.RELEASE.jar,org.springframework.jdbc-3.0.0.RELEASEorg.springframework.beans-3.0.0.RELEASE.jar等

    spring3.1 官方全部jar包

    org.springframework.aop-3.1.RELEASE.jar org.springframework.asm-3.1.RELEASE.jar org.springframework.aspects-3.1.RELEASE.jar org.springframework.beans-3.1.RELEASE.jar org.springframework.context....

    通过import org.springframework.web.multipart.MultipartFile;上传文件

    通过import org.springframework.web.multipart.MultipartFile;上传文件的一个工具性的jar.

    org.springframework.orm-3.0.0.M1.jar

    org.springframework.orm-3.0.0.M1.jar

    org.springframework.context-3.1.1.RELEASE.jar

    org.springframework.context-3.1.1.RELEASE.jar java 开发专用

    org.springframework.orm.hibernate3.LocalSessionFactoryBean

    ### 关于 "org.springframework.orm.hibernate3.LocalSessionFactoryBean" 未找到问题的知识点解析 #### 一、问题背景 在开发基于Spring与Hibernate整合的应用时,可能会遇到“`org.springframework.orm.hibernate...

    spring3.1.1jar及其关联jar

    org.springframework.aop-3.1.1.RELEASE org.springframework.asm-3.1.1.RELEASE org.springframework.aspects-3.1.1.RELEASE org.springframework.beans-3.1.1.RELEASE org.springframework.context.support-3.1.1....

Global site tag (gtag.js) - Google Analytics