若依配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配置一定要改

最后好了


相关文章
|
4月前
Consider defining a bean of type 'org.springframework.security.authentication.AuthenticationManager' in your configuration.
Consider defining a bean of type 'org.springframework.security.authentication.AuthenticationManager' in your configuration.
108 0
|
5月前
|
Java Spring
nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException(Spring循环依赖问题)
nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException(Spring循环依赖问题)
123 0
|
5月前
|
XML Java Apache
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
|
7月前
|
Java
SpringBoot注入出现@org.springframework.beans.factory.annotation.Autowired(required=true)
SpringBoot注入出现@org.springframework.beans.factory.annotation.Autowired(required=true)
109 0
|
6月前
|
Java Spring
【ERROR】Exception in thread “main“ org.springframework.beans.factory.NoSuchBeanDefinitionException
【ERROR】Exception in thread “main“ org.springframework.beans.factory.NoSuchBeanDefinitionException
52 0
|
Java 微服务 Spring
【Java异常】Spring boot启动失败@org.springframework.beans.factory.annotation.Autowired(required=true)
【Java异常】Spring boot启动失败@org.springframework.beans.factory.annotation.Autowired(required=true)
329 0
|
7月前
|
安全 Java 数据库连接
java.lang.NoClassDefFoundError: org/springframework/beans/factory/config/YamlProcessor$StrictMapAppe
java.lang.NoClassDefFoundError: org/springframework/beans/factory/config/YamlProcessor$StrictMapAppe
73 0
|
7月前
解决The injection point has the following annotations:@org.springframework.beans.factory.annotation错误~
解决The injection point has the following annotations:@org.springframework.beans.factory.annotation错误~
1171 0
|
7月前
|
容器
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException:
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException:
115 0
|
Java 数据库连接 Spring
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘ XXX‘
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘ XXX‘
301 0