需要一个bean但找不到

解决

我们在controller使用的service没有注入spring容器,那么我们可以在启动类上,加上包扫描注解,让这个bean所在的包能扫描到:

@ComponentScan(basePackages = {"org.lin.hms.service"})

Field userService in com.lin.hms.controller.LogController required a bean of type 'org.lin.hms.service.UserService' that could not be found.的更多相关文章

  1. Spring Cloud Ribbon负载均衡配置类放在Spring boot主类同级增加Exclude过滤后报Field config in com.cloud.web.controller.RibbonConfiguration required a bean of type 'com.netflix.client.config.IClientConfig' that could not b

    环境: Spring Cloud:Finchley.M8 Spring Boot:2.0.0.RELEASE 目录结构: 可以看到代码第13行的注释,我已经在@ComponentScan注解中添加了E ...

  2. Field userService in com.wuji.controller.UserController required a bean of type 'com.wuji.service.UserService' that could not be found

    Field userService in com.wuji.controller.UserController required a bean of type 'com.wuji.service.Us ...

  3. 解决办法 Field userService in com.sxsj.controller.RegistLoginController required a bean of type

    转自:https://blog.csdn.net/awmw74520/article/details/82687288 APPLICATION FAILED TO START Error starti ...

  4. SpringCloud报错: "Field discoveryClient in com.controller.DcController required a bean of type 'com.netflix.discovery.DiscoveryClient' that could not be found."

    SpringCloud报错: "Field discoveryClient in com.controller.DcController required a bean of type 'c ...

  5. org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.oskyhang.gbd.service.UserService] found for dependency: expected at least 1 bean which qualifies as aut

    spring中一个符号的错误居然让我浪费了四五个小时才找出来,不得不给自己了两个耳光.. 由于新建项目与原来项目的目录结构有所不同,copy过来的配置文件,有些地方修改的不彻底,导致spring扫描注 ...

  6. 2. springboot启动报错:Field userMapper in com.service.UserService required a bean of type 'com.dao.UserMapper' that could not be found.

    报错信息: 2018-06-25 14:26:17.103  WARN 49752 --- [  restartedMain] ationConfigEmbeddedWebApplicationCon ...

  7. springboot jpa mongodb 整合mysql Field in required a bean of type that could not be found Failed to load ApplicationContext

    1.完整报错 *************************** APPLICATION FAILED TO START *************************** Descripti ...

  8. 运行springboot项目报错:Field userMapper in XX required a bean of type 'xx' that could not be found.

    运行springboot项目报错: *************************** APPLICATION FAILED TO START ************************** ...

  9. Field redisTemplate in xxxxxx required a bean of type 'org.springframework.data.redis.core.RedisTemplate' that could not be found.

    *************************** APPLICATION FAILED TO START *************************** Description: Fie ...

  10. How to solve the error "Field service in com.xx.xxx.xxxx required a bean of type 'com.aa.bb.cc' that could not be found."

    When runung a SpringBoot demo, I  got a error as following: *************************** APPLICATION ...

随机推荐

  1. vue中常用的插件

    1. wangeditor 富文本编辑器,https://www.wangeditor.com/

  2. NVI手法实现Template Method设计模式

  3. 小米手机MIUI12获取hci.log的方法记录

    按照之前的方式,开发者选项打开获取蓝牙HCI的log开关,但是在本地一直找不到log. 在网上查了很久资料,终于找到有用的方法了.记录一下. 感谢大佬 https://www.jianshu.com/ ...

  4. py打包工具

    库地址: auto-py-to-exe https://pypi.org/project/auto-py-to-exe/ Gooey https://pypi.org/project/Gooey/ 为 ...

  5. jmeter中返回值提取并存储。

    jmeter中,关于对接口提取值如何存入CSV文件并且做到换列操作的处理.我这里简单介绍一下. 1.首先把接口调通(这个是必须条件),确认好需要提取存入csv的字段,这里以统计token跟userid ...

  6. JS中split、slice、splice区别

    splite 定义:该方法是切割字符串的一种方法,该方法主要用于把一个字符串分割成字符串数组并且返回新生成的数组.用于字符串对象   语法:str.split(separator,howmany) 返 ...

  7. Python面向对象编程——__init()__方法

    隐式基类object 每个python类都隐式继承object 全文代码实例实现:枚举扑克牌的花色和牌面值 一._init()__方法:对象初始化 显示而非隐式:__init()__应显示展示初始化变 ...

  8. Coursera Programming Languages, Part B 华盛顿大学 Week 3

    ML Versus Racket 同 函数编程模式 (with constructs that encourage a functional style) 不鼓励 mutation (但提供了支持 m ...

  9. Samsung Wlan AP 默认口令

    网络资产搜索: FoFa 进入页面 输入该产品账户密码   在github上面寻找 End!!!

  10. spring session + redis实现共享session

    一.代码 1.pom.xml <!--spring session--> <dependency> <groupId>org.springframework.boo ...