`

Mapped Statements collection does not contain value for...

 
阅读更多
Spring整合mybatis main方法测试报错:
Exception in thread "main" java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.Product.dao.ProductMapper.getAllProduct
at org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:593)
at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:393)
at org.apache.ibatis.binding.MapperMethod.setupCommandType(MapperMethod.java:160)
at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:48)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:37)
at $Proxy9.getAllProduct(Unknown Source)
at com.Product.service.ProductService.getAllProduct(ProductService.java:16)
at com.Product.service.ProductService$$FastClassByCGLIB$$59bee94b.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)
 
错误原因:DAO层下xml里的namespace配置不正确或者干脆没有配置namespace
找了一上午,浪费我时间!!!怒!
分享到:
评论

相关推荐

    mybatisMapped报错 Statements collection does not contain value for

    在使用MyBatis框架进行数据库操作时,可能会遇到“Mapped Statements collection does not contain value for”这样的错误提示。这通常意味着MyBatis无法找到与指定的ID相对应的映射语句。下面将详细解释这个问题的...

    CRM在通用.doc

    ### CRM在通用汽车中的应用及重要性 #### 一、上海通用汽车背景介绍 上海通用汽车有限公司是由上海汽车工业(集团)总公司与美国通用汽车公司共同出资成立的大型合资企业,双方各占50%的股份,总投资额达到了15.2亿...

    mybatis 报空值异常

    除了上述情况外,还可能出现其他类型的错误,如 `MappedStatements collection does not contain value for...` 这类异常,通常是由以下几个原因导致的: 1. **Mapper XML 中缺少命名空间** 确保 mapper 文件中...

    如何解决Mybatis--java.lang.IllegalArgumentException: Result Maps collection already contains value for X

    在整合Spring、Struts2和Mybatis的过程中,可能会遇到各种问题,其中之一就是`java.lang.IllegalArgumentException: Result Maps collection already contains value for X`。这个问题通常出现在Mybatis配置文件中,...

    MyBatis User Guide.rar

    Exploring Mapped SQL Statements . 7 A Note about Namespaces........... 8 Scope and Lifecycle .......... 9 Mapper Configuration XML 10 properties ........ 11 settings ............ 12 typeAliases...

    基于springboot+mybatis实现的外卖订餐系统源码+项目说明(毕设).zip

    Mapped Statements collection already contains value for com.m.dao.AdminDao.login at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType ...

    FileMap 是一个用 Java 编写的,基于文件的高性能本地 Key - Value 存储.zip

    Key-Value 存储是一种常见的数据存储模型,其中每个条目由一个唯一的键(Key)和与之关联的值(Value)组成。这种结构便于快速查找和访问数据,因为可以通过键直接定位到值。FileMap 将这个概念扩展到了文件级别,...

    c# 共享内存,MemoryMappedFiles

    当处理大型数据或需要在多个进程(或多个程序)之间共享数据时,MemoryMappedFiles(内存映射文件)是一种非常有用的技术。它允许将文件映射到进程的虚拟内存中,从而可以直接在内存中读取和写入文件的内容,而无需...

    一个struts2的例子:彻底解决STRUTS2 错误There is no Action mapped for namespace / and action name login

    前几天在网上下载一个struts2的helloword的例子,那个作者也真够缺德的,搞个错误的程序,害得我查了一天的程序错误。 最后发现竟然是struts.xml被写成啦sturts.xml。 碰见这样的问题先鄙视下提供例子的作者, ...

    Visual.Studio.Tools.for.Office.Using.C.Sharp.with.Excel.Word.Outlook.and.InfoPath.Sep.2005

    Copyright Praise for Visual Studio Tools for Office Microsoft .NET Development Series Titles in the Series About the Authors Foreword Preface Acknowledgments ...

    Visual.Studio.Tools.for.Office.Using.C.Sharp.with.Excel.Word.Outlook.and.InfoPath.Sep.2005.part2

    Copyright Praise for Visual Studio Tools for Office Microsoft .NET Development Series Titles in the Series About the Authors Foreword Preface Acknowledgments ...

    JLink_Windows_V648.zip

    DLL: Renesas RX: When connecting to locked RX devices via JTAG (does not affect FINE!), 16-byte IDCODE (OSIS) could be rejected even though the correct code was given. Fixed. DLL: Renesas S7G2: QSPI ...

    Collections

    This process does not affect the original dictionary. ##### Using Custom Keys Dictionaries can use any hashable type as a key. Custom keys can be implemented by conforming to the `Hashable` ...

    TCPMouseHook.v1.0.For.Delphi.4.5.6.7.Cracked

    Hooking into the Windows API is a complicated process and there are several techniques to achieve this.Microsoft recommends that the callback procedure for most hooks should reside within a DLL, this ...

    TCPKeyHook.v1.4.For.Delphi.4.5.6.7 Cracked

    Hooking into the Windows API is a complicated process and there are several techniques to achieve this.Microsoft recommends that the callback procedure for most hooks should reside within a DLL, this ...

    EurekaLog_7.5.0.0_Enterprise

    31)..Fixed: Removed exported helper _462EE689226340EAA982C5E8307B3F9E function (replaced with mapped file) 32)..Changed: Descriptions of EurekaLog project options now list corresponding property names...

    微软内部资料-SQL性能优化2

    Assuming the page reference does not result in an access violation, a page fault can be either hard or soft. A hard page fault results in a read from disk, either a page file or memory-mapped file. A...

    acpi控制笔记本风扇转速

    _HID does not match the predefined PCI Root Bridge IDs, the _CID list (if present) is now obtained and also checked for an ID match. Implemented additional support for the PCI _ADR execution: up...

Global site tag (gtag.js) - Google Analytics