启动项目报错:org.springframework.beans.factory.UnsatisfiedDependencyException
dubbo项目:
启动项目报错:(web端)
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userController': Unsatisfied dependency expressed through field 'userService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.refile.api.service.UserService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
原因:
一直以为是dubbo端服务没有正常提供接口服务,但发现报错的内容和找不到dubbo接口服务异常内容不一样,所以怀疑不是dubbo提供接口服务问题。
找了半天发现是web端启动的时候没有扫描到dubbo消费端的配置文件。
解决办法:
修改web.xml文件的内容:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring/refile-mvc.xml</param-value>
</context-param>
改为classpath:spring/*.xml
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring/*.xml</param-value>
</context-param>
spring监听器:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring/refile-mvc.xml</param-value>
</context-param>
启动项目报错:org.springframework.beans.factory.UnsatisfiedDependencyException的更多相关文章
- SSM整合报错org.springframework.beans.factory.UnsatisfiedDependencyException
我解决的办法是把.m2仓库所有文件删除,重新maven project就可以了. 但是在做这一步之前,报错如下: ①org.springframework.beans.factory.Unsatisf ...
- 【spring boot】使用注解@ConfigurationProperties读取配置文件时候 报错 org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'rocketmqAutoConfiguration': Unsatisfied dependenc
如题,配置文件如下: #注册中心配置 eureka: instance: instanceId: ${spring.application.name}:${random.int} hostname: ...
- Tomcat 启动时项目报错 org.springframework.beans.factory.BeanCreationException
事情是这样的,最近我们公司需要将开发环境和测试环境分开,所以就需要把所有的项目部署一套新的开发环境. 我们都是通过 Jenkins 进行部署的,先说一下两个环境的配置: 测试环境配置(旧):jdk1. ...
- java项目报错: org.springframework.beans.factory.BeanCreationException找不到mapper.xml文件
错误代码 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userSer ...
- tomcat启动报错:org.springframework.beans.factory.BeanCreationException
Web容器在启动时加载 spring 配置文件时解析xml失败常常引起容器启动失败.这次配置文件是 ibatis的sql脚本出了问题: Context initialization failed or ...
- springboot 报错 org.springframework.beans.factory.NoSuchBeanDefinitionException:No qualifying bean of type 'com.example.service.HrService' available: 有没有大佬出个主意,我找了一天,刚入门springboot
话不多说先上图,这是启动类的配置,这里配置了@ComponentScan("我的mapper的接口") 接下来是我的项目结构截图 然后是service 的截图,我在这里加了注解@S ...
- Spring AOP 报错org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'XXXXXX' defined in class path resource..........
完整报错如下: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'befo ...
- 报错org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [bean.xml]
报这种错的原因基本上是applicationContext.xml文件中bean配置错误,错误如下: org.springframework.beans.factory.BeanCreationExc ...
- spring装载配置文件失败报错:org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException
Tomcat容器启动失败,找到 debug日志一看: Context initialization failed org.springframework. beans.factory.xml.XmlB ...
- 报错org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [org.mybatis.spring.SqlSessionFactoryBean]
超级大坑 org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [org.mybati ...
随机推荐
- 用户命令切换-命令su
命令su格式为su [-] username su su - su test su root
- Rep Invariant and Abstraction Function
* According to the Reading 13 of MIT 6.005 course In order to finish Lab 2, in which the ps 2 gives ...
- Spark RDD概念学习系列之action操作
不多说,直接上干货! action操作
- ssh: connect to host port 22: Connection refused
配置Linux的互信,互信完成后,连接需要+端口才可以已经将端口修改为7777,但依旧走的是默认的22端口修改方式:[root@yoon ssh]# vi /etc/servicesssh ...
- CorelDRAW简单绘制的一杯满满的橙汁教程
CorelDRAW怎么画一杯橙汁?方法很简单,首先绘制一个闭合路径,执行线性渐变,填充颜色:复制图形,使用刻刀工具裁剪两半,更改不透明度:然后为橙汁增加底部椭圆:修剪橙子片:绘制吸管:最后加上一层橙子 ...
- mongodb配置文件详解
logpath=/app/mongo/mongolog/mongo.log dbpath=/app/mongo/mongodata verbose = true #vvvv = true #此项会产生 ...
- day15 函数对象以及作用域
目录 函数对象 函数对象的四大功能 函数的嵌套 名称空间和作用域 名称空间 考试必考 作用域 global nonlacal LEGB原则 函数对象 ==Python中一切皆对象== 函数名也可以看成 ...
- java文件名与class关系
class与文件名没有必要关系但是public class是要绝对保持一致 例如:class test{ public static void main(String args[]){ System. ...
- Chrome Is The New C Runtime
出处:https://www.mobilespan.com/content/chrome-is-the-new-c-runtime Chrome Is The New C Runtime Date: ...
- UVALive-8072 Keeping On Track 树形dp 联通块之间缺失边的个数
题目链接:https://cn.vjudge.net/problem/UVALive-8072 题意 给出n+1个点和n条边,每对点之间只能存在一条边. 现在要找出一个节点,使得去掉这个点后,所剩每对 ...