• Mapped Statements collection does not contain value for com.xxxx.dao.impl.AreaDAOImpl.findByCode



    org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
    ### Error querying database. Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.sports.basic.area.dao.impl.AreaDAOImpl.findByCode
    ### Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.sports.basic.area.dao.impl.AreaDAOImpl.findByCode
    at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73)
    at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:365)
    at com.sun.proxy.$Proxy16.selectOne(Unknown Source)
    at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:160)
    at com.sports.basic.area.dao.impl.AreaDAOImpl.findByCode(AreaDAOImpl.java:22)
    at com.sports.basic.area.service.impl.AreaServiceImpl.getAreaByCode(AreaServiceImpl.java:24)
    at com.sports.basic.area.AreaServcieTest.test1(AreaServcieTest.java:36)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
    at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
    at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83)
    at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:88)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
    at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
    at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:78)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:212)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:68)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
    Caused by: org.apache.ibatis.exceptions.PersistenceException:
    ### Error querying database. Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.sports.basic.area.dao.impl.AreaDAOImpl.findByCode
    ### Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.sports.basic.area.dao.impl.AreaDAOImpl.findByCode
    at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:26)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:111)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:102)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:66)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:355)
    ... 36 more
    Caused by: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.sports.basic.area.dao.impl.AreaDAOImpl.findByCode
    at org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:797)
    at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:631)
    at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:624)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:107)
    ... 43 more

    郁闷了半天,无语,我的其他mapper文件都是xxxx-mapper.xml

    而这个mapper是从其他地方copy过来的,太像了,尼玛,是xxxx_mapper.xml

    坑了我好几个小时,麻蛋

  • 相关阅读:
    这年头学爬虫还就得会点 scrapy 框架
    【全栈之路】JAVA基础课程十_JAVA虚拟机(20190706v1.1)
    牛客练习赛61
    ERD图
    深入理解Java虚拟机-如何利用VisualVM对高并发项目进行性能分析
    阿里研究员吴翰清:世界需要什么样的智能系统?
    《深入理解 C# (第2版)》
    HtmlAgility 抓取网页上的数据
    abp(net core)+easyui+efcore实现仓储管理系统——入库管理之三存储过程(三十九)
    如何Tomcat完美访问web项目,无需配置“项目名”
  • 原文地址:https://www.cnblogs.com/gmq-sh/p/6833498.html
Copyright © 2020-2023  润新知