整合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 ...
随机推荐
- Qt opencv开发环境
在.pro文件中添加 INCLUDEPATH += C:\opencv\build\include\ #头文件路径 C:\opencv\build\include\opencv\ C:\opencv\ ...
- eclipse中maven的配置与使用
以eclipse Juno版本为例 1.插件安装 eclipse==>help====>install new software===>add name :m2e location: ...
- Eclipse Maven 编译错误 Dynamic Web Module 3.0 requires Java 1.6 or newer 解决方案
Eclipse Maven 开发一个 jee 项目时,编译时遇到以下错误:Description Resource Path Location TypeDynamic Web Module 3.0 r ...
- sed对指定行添加或删除注释
如下文本 zimu.txt aaaaa #bbbbbb cccccc dddddd 以下命令如果需要在文本中更改 需要加 -i 或者 -ri参数 用sed在aaa前加#注释 sed 's/^ ...
- JavaScript去除空格的三种方法(正则/传参函数/trim)
方法一: 个人认为最好的方法.采用的是正则表达式,这是最核心的原理. 其次.这个方法使用了JavaScript 的prototype 属性 其实你不使用这个属性一样可以用函数实现.但这样做后用起来比较 ...
- 提示crontab command not found的解决方法
操作步骤 1. 确认crontab是否安装: 执行 crontab 命令如果报 command not found,就表明没有安装 2. 安装 crontab 执行 yum insta ...
- 及时修改jira的状态
领到一个task,然后,修改task状态为开发状态,并且,点击edit,选择,story points,预估自己这个task大概做几天. 做完task后,再修改task的状态
- Person.delete请求----强大的bug---下班之前总结整个过程
默认访问的是: findAll(query) 还有个findAll(ids,query) 只有findAll才调用了findEntity->findById: 那么我重写了findById,查询 ...
- JavaWeb_静态导入、自动拆箱/装箱
静态导入用于简化程序对类静态属性和方法的调用. 语法 import static 包名.类名.静态属性|静态方法|* 例如 import static java.lang.System.out imp ...
- dreamweaver cs5 快捷键
撤销上一步:ctrl + Z: 回复上一步:ctrl + Y: 代码缩进:左下角(应用原格式)