整合feign过程中出现问题:
一:编译器报错
这个地方是由于没有被spring管理,编译器报错,可以选择加上@comoponent这个注解
也可以选择不加,启动程序是不会报错的.
二 报错为空:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userController': Unsatisfied dependency expressed through field 'personService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.cxy.service.IPersonService': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: PathVariable annotation was empty on param .
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:) ~[spring-beans-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:) ~[spring-beans-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:) ~[spring-beans-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$(AbstractBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:) ~[spring-beans-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:) ~[spring-context-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:) ~[spring-context-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:) ~[spring-boot-2.1..RELEASE.jar:2.1..RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:) [spring-boot-2.1..RELEASE.jar:2.1..RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:) [spring-boot-2.1..RELEASE.jar:2.1..RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:) [spring-boot-2.1..RELEASE.jar:2.1..RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:) [spring-boot-2.1..RELEASE.jar:2.1..RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:) [spring-boot-2.1..RELEASE.jar:2.1..RELEASE]
at com.cxy.UserApplication.main(UserApplication.java:) [classes/:na]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.cxy.service.IPersonService': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: PathVariable annotation was empty on param .
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:) ~[spring-beans-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:) ~[spring-beans-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getObjectForBeanInstance(AbstractAutowireCapableBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:) ~[spring-beans-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.addCandidateEntry(DefaultListableBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar:5.1..RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:) ~[spring-beans-5.1..RELEASE.jar:5.1..RELEASE]
... common frames omitted
Caused by: java.lang.IllegalStateException: PathVariable annotation was empty on param .
at feign.Util.checkState(Util.java:) ~[feign-core-10.1..jar:na]
at org.springframework.cloud.openfeign.annotation.PathVariableParameterProcessor.processArgument(PathVariableParameterProcessor.java:) ~[spring-cloud-openfeign-core-2.1..RELEASE.jar:2.1..RELEASE]
at org.springframework.cloud.openfeign.support.SpringMvcContract.processAnnotationsOnParameter(SpringMvcContract.java:) ~[spring-cloud-openfeign-core-2.1..RELEASE.jar:2.1..RELEASE]
at feign.Contract$BaseContract.parseAndValidateMetadata(Contract.java:) ~[feign-core-10.1..jar:na]
at org.springframework.cloud.openfeign.support.SpringMvcContract.parseAndValidateMetadata(SpringMvcContract.java:) ~[spring-cloud-openfeign-core-2.1..RELEASE.jar:2.1..RELEASE]
at feign.Contract$BaseContract.parseAndValidatateMetadata(Contract.java:) ~[feign-core-10.1..jar:na]
at feign.ReflectiveFeign$ParseHandlersByName.apply(ReflectiveFeign.java:) ~[feign-core-10.1..jar:na]
at feign.ReflectiveFeign.newInstance(ReflectiveFeign.java:) ~[feign-core-10.1..jar:na]
at feign.Feign$Builder.target(Feign.java:) ~[feign-core-10.1..jar:na]
at org.springframework.cloud.openfeign.HystrixTargeter.target(HystrixTargeter.java:) ~[spring-cloud-openfeign-core-2.1..RELEASE.jar:2.1..RELEASE]
at org.springframework.cloud.openfeign.FeignClientFactoryBean.loadBalance(FeignClientFactoryBean.java:) ~[spring-cloud-openfeign-core-2.1..RELEASE.jar:2.1..RELEASE]
at org.springframework.cloud.openfeign.FeignClientFactoryBean.getTarget(FeignClientFactoryBean.java:) ~[spring-cloud-openfeign-core-2.1..RELEASE.jar:2.1..RELEASE]
at org.springframework.cloud.openfeign.FeignClientFactoryBean.getObject(FeignClientFactoryBean.java:) ~[spring-cloud-openfeign-core-2.1..RELEASE.jar:2.1..RELEASE]
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:) ~[spring-beans-5.1..RELEASE.jar:5.1..RELEASE]
... common frames omitted Process finished with exit code
这个主要看最后一个是参数不存在的错误
说明问题:
问题解决方法
整合feign过程中出现问题:的更多相关文章
- SSM整合搭建过程中的一个怪异问题
好久没有搭建框架了,昨天开始试图搭建一个SSM框架,各种配置文件搭建成功,服务器也启动正确,但是在运行过程中,发现总是不能获取JDBC,不能够创建连接池工厂,报错如下:网页报500错误码 SEVERE ...
- Spring3+hibernate4+struts2整合的 过程中发生如下错误
严重: Error configuring application listener of class org.springframework.web.context.ContextLoaderLis ...
- hibernate4.3.8整合struts2过程中遇到的问题
1.遇到的异常: Exception in thread "main" org.hibernate.service.spi.ServiceException: Unable to ...
- springMVC+spring+mybatis整合过程中遇到的问题
今天在配置SSM整合的过程中遇到了几个错误,折腾了好久,具体如下 1.java.lang.IllegalArgumentException: Mapped Statements collection ...
- MySQL Fabric和MyBatis的整合过程中遇到的问题
这是我昨天在整合MySQL Fabric和MyBatis时遇到的问题,花了大半天才解决的问题,解决的过程中在网上查找了很久,都没有找到解决的方案.现在记下来,希望能够帮助有同样问题的朋友.如果各位朋友 ...
- hibernate4整合spring3.1的过程中的异常问题
(1)hibernate4整合spring3.1的过程中,发现了java.lang.NoClassDefFoundError: Lorg/hibernate/cache/CacheProvider异常 ...
- SpringCloud整合过程中jar依赖踩坑经验
今天在搭建SpringCloud Eureka过程中,一直在报pom依赖错误,排查问题总结如下经验. 1.SpringBoot整合SpringCloud两者版本是有严格约束的,详细见SpringBoo ...
- Spring4 与 Hibernate4 整合过程中的问题记录
Spring4使用注解配置,很方便也很有趣,就是有一些坑需要自己去发现和解决,笔者列出自己在使用过程中遇到的问题,希望对您有所帮助. 1.如果使用hibernate.cfg.xml配置文件配置Hibe ...
- Spring Cloud Alibaba Sentinel 整合 Feign 的设计实现
作者 | Spring Cloud Alibaba 高级开发工程师洛夜 来自公众号阿里巴巴中间件投稿 前段时间 Hystrix 宣布不再维护之后(Hystrix 停止开发...Spring Cloud ...
随机推荐
- Beautiful Soup 4.2.0
Beautiful Soup 是一个可以从HTML或XML文件中提取数据的Python库.它能够通过你喜欢的转换器实现惯用的文档导航,查找,修改文档的方式 快速开始 pip install beaut ...
- java之链表
链表是一种物理存储单元上非连续.非顺序的存储结构. 链表是由那几个部分组成的呢? 是由N个节点组成的 每一个节点分为两部分: 1.数据域 ...
- python中注释的书写
与c和c++的//不同的是,在python中我们使用#来进行注释 每个#所在的那一行都可以叫做注释:
- MySQL在cmd和python下的常用操作
环境配置1:安装mysql,环境变量添加mysql的bin目录 环境配置2:python安装MySQL-Python 请根据自身操作系统下载安装,否则会报c ++ compile 9.0,import ...
- 2018多校第九场1010 (HDU6424) 数学
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6424 解法:找规律.因为最多三项,a1^a2^a3可以拆成(a1+2)+(a2+1)*a3,然后建成数 ...
- 使用Java2D改善API的绘制效果
---------------siwuxie095 工程名:TestSwingPaintAPI 包名:com.siwuxie095.swingp ...
- Swing框架的继承关系
---------------siwuxie095 Java SE 8 (截止 2017/4/1 最新)在线 API 文档: http://docs.oracle.com/javase/8/docs/ ...
- 简单的jQuery前端验证码校验
简单的jQuery前端验证码校验2 html; <!DOCTYPE html> <html lang="zh-cn"> <head> <m ...
- ARC102E Stop. Otherwise...
传送门 题目大意 现在有n个k面的骰子,问在i=2~2*k的情况下,任意两个骰子向上那一面的和不等于i的方案数是多少. 分析 这道题具体做法见这个博客. 至于k2的值为啥是那个自己画画图就明白了. 代 ...
- SDUT 3401 数据结构实验之排序四:寻找大富翁.!
数据结构实验之排序四:寻找大富翁 Time Limit: 150MS Memory Limit: 512KB Submit Statistic Problem Description 2015胡润全球 ...