需要一个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. linux 中sed命令如何删除第一列和最后一列

    删除第一列 (base) root@PC1:/home/test# cat test.txt1 MIR1302-10 12 FAM138A 23 OR4F5 34 RP11-34P13.7 45 RP ...

  2. antd DatePicker限制日期的选择

    import React from 'react'; import ReactDOM from 'react-dom'; import {Input,DatePicker,Form,Col,Butto ...

  3. 上传文件-jq

    var formFile = new FormData(); formFile.append("[file]", fileObj); formFile.append("t ...

  4. 移动端判断是否存在app

    网上有很多类似的判断,我看到的最新的是2020年的 但是在我项目中都遇到了问题 ios很简单,只要你给出跳转app的url就可以了,如果没有app就会自动的去调到app store 安卓系统就很恶心了 ...

  5. Android Studio实现数据库的所有操作

    采用android studio自带的数据库实现stu数据库和stu表的创建,增删改查和关闭 这是项目的大致结构 主界面 子界面 布局源码 <!-- Main --> <?xml v ...

  6. 物联网之Wifi协议

    今天来重点介绍一下WIfi协议,咱们用的其实已经很多了. 主要内容: ⼀.基本概述 ⼆.实践基础 三.⼀些原理 ⼀.基本概述 ============================ 1.有线和⽆线⽹ ...

  7. 微信浏览器h5页面开发遇到问题

    1.ios不支持window.open(),要创建a链接 let elink = document.createElement('a'); elink.href = baseURL+'/onlineC ...

  8. WebStore 破解

    前提 你需要首先安装该软件,并下载补丁,不过这些已经为你打包好了. WebStore 2020.1 , jetbrains-agent.jar , resources_zh_CN_WebStorm_2 ...

  9. vue中sso登录使用VueKeycloak登录

    一,先下载vuekeycloakjs npm install @dsb-norge/vue-keycloak-js --save 二,引入 import VueKeycloakJs from '@ds ...

  10. 20200923--计算鞍点(奥赛一本通P91 4)

    给定一个5*5的矩阵,每行只有一个最大值,每列只有一个最小值,寻找这个矩阵的鞍点.鞍点指的是矩阵中的一个元素,它是所在行的最大值,并且是所在列的最小值. 例如:在下面的例子中(第4行第1列的元素就是鞍 ...