idea 中 target 不存在 mybatis的xml文件

将原本在Eclipse中运行正常的Maven项目迁移到IntelliJ IDEA后,遇到调用Mapper接口报错,原因是IDEA默认不将src/main/java目录下的XML文件复制到target目录。解决方法是在pom.xml中添加资源配置,包含src/main/java下的所有XML文件,并执行Maven的Reimport操作,确保Mapper XML文件出现在正确位置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

转载自:https://i-blog.csdnimg.cn/blog_migrate/b31253664b7ae19b53321e8db8d8cc59.png

原本在Eclipse中好好的MAVEN项目,导入intellij idea中,服务器启动正常,但在调用userMapper接口时,报以下异常:

[java]  view plain   copy
  1. org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.beauxie.wxj.dao.UserMapper.findUserByCondition  
  2.     at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:178)  
  3.     at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:38)  
  4.     at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:49)  
  5.     at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:42)  
  6.     at com.sun.proxy.$Proxy10.findUserByCondition(Unknown Source)  
  7.     at com.beauxie.wxj.service.impl.UserServiceImpl.validata(UserServiceImpl.java:61)  
  8.     at com.beauxie.wxj.service.impl.UserServiceImpl.validataUsername(UserServiceImpl.java:35)  
  9.     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
  10.     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)  
  11.     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
  12.     at java.lang.reflect.Method.invoke(Method.java:606)  
  13.     at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)  
  14.     at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)  
  15.     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)  
  16.     at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值