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路径和接口路径一直 我压根不是这样设置的

问题随解决

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

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

【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛

【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...

(0)


相关推荐

发表回复

您的电子邮箱地址不会被公开。

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