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)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 适用于protel99SE初学者

    适用于protel99SE初学者本文适合零基础者学习protel99SE很多网友渴望自己设计电路原理图(SCH)、电路板(PCB),同时希望从原始SCH到PCB自动布线、再到成品PCB电路板的设计周期可以缩短到1天以内!是不是不可能呢?当然不是,因为现在的EDA软件已经达到了几乎无所不能的地步!由于电子很重实践,可以说,不曾亲自设计过PCB电路板的电子工程师,几乎是不可想象的。很多电子爱好者都有过学…

    2022年5月7日
    49
  • 周期性学习率(Cyclical Learning Rate)技术[通俗易懂]

    周期性学习率(Cyclical Learning Rate)技术[通俗易懂]本文介绍神经网络训练中的周期性学习率技术。Introduction学习率(learning_rate,LR)是神经网络训练过程中最重要的超参数之一,它对于快速、高效地训练神经网络至关重要。简单来说,LR决定了我们当前的权重参数朝着降低损失的方向上改变多少。new_weight=exsiting_weight-learning_rate*gradient这看上去很简单。但是…

    2022年5月18日
    34
  • webstrom激活码【中文破解版】

    (webstrom激活码)这是一篇idea技术相关文章,由全栈君为大家提供,主要知识点是关于2021JetBrains全家桶永久激活码的内容IntelliJ2021最新激活注册码,破解教程可免费永久激活,亲测有效,下面是详细链接哦~https://javaforall.net/100143.html0E14HXZ4QL-eyJsaWN…

    2022年3月28日
    155
  • WLAN基本知识之802.11标准「建议收藏」

    WLAN基本知识之802.11标准「建议收藏」文章目录WLAN技术基础1.4802.11标准介绍1.4.1IEEE802.11协议族成员1.4.2IEEE802.11标准与WiFi的世代1.4.3802.11a/b/g差异1.4.4802.11n1.4.5802.11n关键技术1.4.6IEEE802.11ac标准1.4.7IEEE802.ax标准(又称WiFi6)1.4.8WiFi6理论速率计算WLAN技术基础1.4802.11标准介绍1.4.1IEEE802.11协议族成员IEEE805.11无线工

    2022年7月11日
    22
  • php中 instanceof有什么作用

    php中 instanceof有什么作用

    2021年10月17日
    41
  • Java输入输出(标准)

    Java输入输出(标准)简述Java输入就需要自己构造类了。其中nextLine()这个方法,表示的是,一直读,读到有换行符之后就截至(不取换行符)代码importjava.util.*;publicclassTest{publicstaticvoidmain(String[]args){Scannerin=newScanner(System….

    2022年5月15日
    36

发表回复

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

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