mybaties 错误[通俗易懂]

mybaties 错误[通俗易懂]先看下错误org.apache.ibatis.binding.BindingException:Invalidboundstatement(notfound):com.sinofaith.idaplus.goodsitem.mapping.GoodslowInfoPOMapper.selectByPrimaryKeyatorg.apache.ibatis.bindin

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全家桶1年46,售后保障稳定

先看下错误

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.sinofaith.idaplus.goodsitem.mapping.GoodslowInfoPOMapper.selectByPrimaryKey
at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:189)
at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:43)
at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:58)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:51)
at com.sun.proxy.$Proxy12.selectByPrimaryKey(Unknown Source)
at com.sinofaith.idaplus.goodsitem.service.impl.LowPriceAnalysisServiceImpl.getListByBrandPlatformAndDate(LowPriceAnalysisServiceImpl.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at com.sun.proxy.$Proxy14.getListByBrandPlatformAndDate(Unknown Source)
at com.sinofaith.idaplus.notice.mail.impl.LowPriceResultMailSendImpl.getGoodsLowPriceInfo(LowPriceResultMailSendImpl.java:209)
at com.sinofaith.idaplus.notice.mail.impl.LowPriceResultMailSendImpl.sendMail(LowPriceResultMailSendImpl.java:191)
at com.sinofaith.idaplus.notice.mail.impl.LowPriceResultMailSendImpl.autoSendMail(LowPriceResultMailSendImpl.java:135)
at com.sinofaith.idaplus.notice.mail.impl.LowPriceResultMailSendImpl.sendMsg(LowPriceResultMailSendImpl.java:83)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:269)
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:311)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:113)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)

解决这个问题还是有点麻烦的 刚开始是认为是xml包结构和接口包结构不一致所致 试了很久没成功

然后看到了一篇写的蛮好的博客

https://my.oschina.net/psuyun/blog/464851

然后看了下原项目的配置

<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
    <property name="configLocation" value="classpath:/config/mybatis-config.xml" />
    <!-- 映射文件集合 -->
    <!--<property name="mapperLocations" value="classpath:/com.sinofaith.idaplus.*/*.xml" />-->
    <property name="mapperLocations" value="classpath*:/mapper.*/*.xml" />
    <property name="dataSource" ref="dataSource" />
</bean>

Jetbrains全家桶1年46,售后保障稳定

然后发现 原本系统设置的包文件路径mapper下面所有的包

可是为了保证xml路径和接口路径一直 我压根不是这样设置的

问题随解决

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/234556.html原文链接:https://javaforall.net

(0)
上一篇 2025年6月1日 下午2:43
下一篇 2025年6月1日 下午3:15


相关推荐

  • php数据库根据手机号获取归属地,PHP通过API获取手机号码归属地

    php数据库根据手机号获取归属地,PHP通过API获取手机号码归属地该API接口自2011年SAE平台上线稳定运行至今,增加了17号段的支持,欢迎各种采集注限制,并发10详细使用说明接口地址:http://appyun.sinaapp.com/index.php?app=mobile&controller=index&action=api请求方法:GET请求参数:参数名类型必填参数位置描述默认值appstring是urlPar…

    2022年7月22日
    16
  • 深入解析:腾讯混元翻译模型Hunyuan-MT-7B开源,先前拿了30个冠军

    深入解析:腾讯混元翻译模型Hunyuan-MT-7B开源,先前拿了30个冠军

    2026年3月12日
    2
  • 一个导致502 bad gateway的原因[通俗易懂]

    一个导致502 bad gateway的原因[通俗易懂]最近一段时间系统经常出现502badgateway,一开始没在意,以为是偶发现象,后来越来越多改了nginx配置,问题没有解决观察日志,出现502badgateway时系统并没有出异常,猜测可能系统负载较大,把所有定时任务迁移到另外一台服务器,问题仍然没有解决最后通过Jconsole监控JVM发现每5分钟的第0秒,线程和内存曲线都会降为0,这个时候正好是出

    2022年6月18日
    50
  • Vue实现页面跳转

    Vue实现页面跳转如何点击底部书架跳转到对应的页面 router link to name bookshelf params entityId this entityId class flex item 1 flex item 1 cur tabs 0 isShow href javascript router link to name bookshelf params entityId this entityId class flex item 1 flex item 1 cur tabs 0 isShow href javascript

    2026年3月20日
    1
  • 平台使用指引

    平台使用指引

    2026年3月12日
    2
  • Gradle 安装配置详解

    Gradle 安装配置详解官方文档 https docs gradle org current userguide installation html installing manually 说明 gradle 是基于 ApacheAnt 和 ApacheMaven 概念的项目自动化构建开源工具 也提供了很多第三方插件 在 JavaWeb 项目中通常会用到 java war maven 等插件管理项目 实现项目自动构建 jar 依赖等功能 本章记录作者在 windows 系统中安装 配置 gradle6 0 1 的完整过程 一

    2026年3月20日
    1

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号