Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
来源:互联网 发布:php思想 编辑:程序博客网 时间:2024/06/04 23:36
这个错误看起来很明显
说的是这个注入的类是必须存在的,但是呢,这个注入的类不存在
当然,我的项目中很明显存在
我的项目是 spring spring MVC mybatis三个框架整合
分4层
控制层 XxxController 注解@Controller
服务层 XxxService 注解 @Service
持久层 XxxDao 注解 @Repository
最后就是mybatis的mapper接口 注解为@Component
关于这几个注解的含义,百度如下
看字面含义,很容易却别出其中三个:@Controller 控制层,就是我们的action层@Service 业务逻辑层,就是我们的service或者manager层@Repository 持久层,就是我们常说的DAO层 而@Component (字面意思就是组件),它在你确定不了事哪一个层的时候使用。 其实,这四个注解的效果都是一样的,spring都会把它们当做需要注入的Bean加载在上下文中;但是在项目中,却建议你严格按照除Componen的其余三个注解的含义使用在项目中。这对分层结构的web架构很有好处!!
百度了好久,没找到合适的
就一次次实验
发现是个摸不到头脑的的问题,为什么这样我也不知道
就是把 mybatis的mapper接口的注解
@Component
改成@Repository
最后就可以了
0 0
- Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)
- 报错:Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
- Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
- @org.springframework.beans.factory.annotation.Autowired(required=true)
- @org.springframework.beans.factory.annotation.Autowired(required=true)
- mapper注入失败问题解决 {@org.springframework.beans.factory.annotation.Autowired(required=true)}
- Spring异常: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
- bug解决_{@org.springframework.beans.factory.annotation.Autowired(required=true)}
- beans.factory.BeanCreationException beans.factory.annotation.Autowired(required=true)
- 异常:org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor
- Spring的Annotation使用注意(org.springframework.beans.factory.NoSuchBeanDefinitionException)
- org.springframework.beans.factory.BeanCreationException
- org.springframework.beans.factory.BeanCreationException
- org.springframework.beans.factory.BeanCreationException
- org.springframework.beans.factory.BeanDefinitionStoreException
- org.springframework.beans.factory.BeanCreationException
- org.springframework.beans.factory.BeanDefinitionStoreException:
- org.springframework.beans.factory.BeanCreationException
- 【PASCALVOC】The Pascal Visual Object Classes Challenge: A Retrospective
- sleep和wait的区别
- 【IMWeb训练营作业】---Todolist---
- 最方便简单的经纬度查询方法
- 编写虚拟机操作脚本
- Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
- Gulp安装笔记
- 凡人视角C++之string(下)
- Golang 学习之路一:开发环境搭建
- Linux--RH124---unit 14 linux中设备的访问
- IMWeb训练营作业】作业
- Assert()
- 在Servlet中使用getParameter()方法获取get请求中的中文参数乱码解决方法
- 内部类