若依配Mapper,若依修改Caused by: org.springframework.beans.factory.BeanCreationException: Error creating

简介: 若依配Mapper,若依修改Caused by: org.springframework.beans.factory.BeanCreationException: Error creating

参考资料:

解决 Ruoyi 框架中提示认证失败,无法访问系统资源的问题_认证失败,无法访问系统资源

今天修改若依项目的时候,出现了一个bug:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sysConfigServiceImpl': Invocation of init method failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.ruoyi.system.mapper.SysConfigMapper.selectConfigList

翻译

原因:org . spring framework . beans . factory . beancreationexception:创建名为“sysConfigServiceImpl”的bean时出错:调用init方法失败;嵌套异常为org . Apache . ibatis . binding . binding异常:无效的绑定语句(未找到):com . ruoyi . system . mapper . sysconfigmapper . selectconfiglist

这里出错原因是我擅自修改了若依的配置文件,若依的mapper资料在:

这里面的配置文件必须是

mapperLocations: classpath*:mapper/**/*Mapper.xml

如果修改其他会影响其他系统

但是又出现了其他的bug:

A component required a bean of type 'com.ruoyi.web.mappers.codeMapper' that could not be found.

若依如何配置mapper,在任意文件下可以配mapper,不能配mappers,会报错,要写成mapper

后来参考,这篇文章,具体的mapper层配置是

ruoyi若依二次开发怎么添加扫描自己的controller和mapper,配置三个地方即可。_若依mapperscan扫描项目中所有包


也可以在ruoyi-framework中进行添加对应接口


最后原因是自己修改mybatisPlus修改了配置导致的:

若依修改,集成mybatisplus报错,若依集成mybatisplus,总是找不到映射是怎么回事只要是用mp的方法就找报,改成mybatisPlus配置一定要改-CSDN博客

若依修改,集成mybatisplus报错,若依集成mybatisplus,总是找不到映射是怎么回事只要是用mp的方法就找报,改成mybatisPlus配置一定要改

最后好了


目录
打赏
0
0
0
0
42
分享
相关文章
|
11月前
|
SpringBoot注入出现@org.springframework.beans.factory.annotation.Autowired(required=true)
SpringBoot注入出现@org.springframework.beans.factory.annotation.Autowired(required=true)
194 0
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘t
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘t
nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException(Spring循环依赖问题)
nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException(Spring循环依赖问题)
234 0
【Java异常】Spring boot启动失败@org.springframework.beans.factory.annotation.Autowired(required=true)
【Java异常】Spring boot启动失败@org.springframework.beans.factory.annotation.Autowired(required=true)
610 0
|
10月前
|
【ERROR】Exception in thread “main“ org.springframework.beans.factory.NoSuchBeanDefinitionException
【ERROR】Exception in thread “main“ org.springframework.beans.factory.NoSuchBeanDefinitionException
96 0
【问题篇】Caused by: java.lang.NoClassDefFoundError: org/springframework/boot/context/properties/
【问题篇】Caused by: java.lang.NoClassDefFoundError: org/springframework/boot/context/properties/
250 2
【已解决】Caused by: java.lang.ClassNotFoundException: org.springframework.boot.context.properties.
【已解决】Caused by: java.lang.ClassNotFoundException: org.springframework.boot.context.properties.
4107 1
【已解决】Caused by: java.lang.ClassNotFoundException: org.springframework.boot.context.properties.
java.lang.NoClassDefFoundError: org/springframework/beans/factory/config/YamlProcessor$StrictMapAppe
java.lang.NoClassDefFoundError: org/springframework/beans/factory/config/YamlProcessor$StrictMapAppe
94 0
|
11月前
|
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException:
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException:
174 0
|
11月前
解决The injection point has the following annotations:@org.springframework.beans.factory.annotation错误~
解决The injection point has the following annotations:@org.springframework.beans.factory.annotation错误~
1446 0
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等