Error creating bean with name 'com.cloud.feign.interfaces.xxxFeignClient': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalSt.PathVariable annotation was empty on
环境:
Spring Cloud:Finchley.M8
Spring Boot:2.0.0.RELEASE
报错信息:
- Error creating bean with name 'com.cloud.feign.interfaces.xxxFeignClient': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalSt.PathVariable annotation was empty on
Feign接口代码:
- @FeignClient(value = "SPRING-CLOUD-WEB-PROVIDER-GROUP2")
- public interface SongFeignClient {
- @GetMapping("/call/{id}")
- public Object getSongInfo(@PathVariable int id);
- }
报错信息关键点:
- PathVariable annotation was empty on
问题就出在接口方法入参@PathVariable注解这里,在Spring Mvc中可以不明确指定该注解对应的参数名称,但在feign中必须指定,否则将保如上异常,修后的正确代码如下:
- @FeignClient(value = "SPRING-CLOUD-WEB-PROVIDER-GROUP2")
- public interface SongFeignClient {
- @GetMapping("/call/{id}")
- public Object getSongInfo(@PathVariable("id") int id);
- }
Error creating bean with name 'com.cloud.feign.interfaces.xxxFeignClient': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalSt.PathVariable annotation was empty on的更多相关文章
- [bigdata] 启动CM出现 “JDBC Driver class not found: com.mysql.jdbc.Driver” 以及“Error creating bean with name 'serverLogFetcherImpl'”问题的解决方法
问题:“JDBC Driver class not found: com.mysql.jdbc.Driver” 通过以下命令启动cm [root@hadoop1 ~]# /etc/init.d/cl ...
- Error creating bean with name 'org.springframework.validation.beanvalidation.LocalValidatorFactory
Error creating bean with name ‘org.springframework.validation.beanvalidation.LocalValidatorFactoryBe ...
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'catchFromPBomService': Cannot create inner bean '(inner bean)#302efb82' of type [com.thinkgem.jeesite.modules.fd
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'catchFromPBo ...
- cloudera-scm-server启动出现Error creating bean with name 'entityManagerFactoryBean'与HHH010003: JDBC Driver class not found: com.mysql.jdbc.Driver错误解决办法(图文详解)
不多说,直接上干货! 问题详情 -- ::, INFO main:com.cloudera.server.cmf.Main: Starting SCM Server. JVM Args: [-Dlog ...
- Spring Cloud报错Error creating bean with name 'requestMappingHandlerMapping'
如果我们使用Spring Cloud的Feign实现熔断,首先需要自定义一个熔断类,实现你的feign接口,然后实现方法,这些方法就是熔断方法,最后需要在你的feign接口中指定fallback为自定 ...
- spring cloud 报错Error creating bean with name 'hystrixCommandAspect' ,解决方案
spring cloud 升级到最新版 后,报错: org.springframework.beans.factory.BeanCreationException: Error creating be ...
- EurekaClient项目启动报错Invocation of destroy method failed on bean with name 'scopedTarget.eurekaClient': org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'e
Disconnected from the target VM, address: '127.0.0.1:51233', transport: 'socket' Eureka Client的使用 使用 ...
- 【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: ...
- 【解决方案】 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userHandler': Injection of resource dependencies failed;
一个错误会浪费好多青春绳命 鉴于此,为了不让大家也走弯路,分享解决方案. [错误代码提示] StandardWrapper.Throwableorg.springframework.beans.fac ...
随机推荐
- requests模块处理cookie,代理ip,基于线程池数据爬取
引入 有些时候,我们在使用爬虫程序去爬取一些用户相关信息的数据(爬取张三“人人网”个人主页数据)时,如果使用之前requests模块常规操作时,往往达不到我们想要的目的. 一.基于requests模块 ...
- 转载---<html>与<body>
关于根元素html以及body的对比,主要是遇到设置背景色的问题,这里转载张鑫旭的关于html和body对比的文.(直接贴过来,是为了以后自己方便看) 原文地址:http://www.zhangxin ...
- php 缓冲函数
php.ini中有两个关键参数会影响到php的缓存输出控制: output_buffering :on/off 或者整数 .设置为 on 时,将在所有脚本中使用输出缓存控制,不限制缓存的大小.而设置为 ...
- 【算法笔记】B1046 划拳
1046 划拳 (15 分) 划拳是古老中国酒文化的一个有趣的组成部分.酒桌上两人划拳的方法为:每人口中喊出一个数字,同时用手比划出一个数字.如果谁比划出的数字正好等于两人喊出的数字之和,谁就赢了,输 ...
- html的第一个程序
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- POJ - 1961 最小循环节
如果循环节存在那在前缀部分也肯定存在 如果循环节存在那至少是可以匹配的 而next是维护最大前缀的,意会意会 注意一定要先判整除,即使别的题目保证是存在循环的 特意画了一张灵魂草图帮助理解 #incl ...
- Bubble Sort Graph CodeForces - 340D || 最长不下降/上升子序列
Bubble Sort Graph CodeForces - 340D 题意: 给出一个n个数的数列,建一个只有n个结点没有边的无向图,对数列进行冒泡排序,每交换一对位置在(i,j)的数在点i和点j间 ...
- C# 判断两个集合(List)是否相等
1.两个list如果有重复元素(如List1: a,b,a List2: b,b,a) 是无法通过包含关系来判断是否相等的. 有两个办法,其一是两个List排序后再按顺序比较.另一个办法就是计算各元 ...
- hdu1395 2^x mod n = 1(欧拉函数)
2^x mod n = 1 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Tot ...
- python--交互器,编译器
1在写python的时候调交互器的作用 唯一作用:调试代码 2.编译器