解决:ClassNotFoundException: com.netflix.hystrix.contrib.javanica.aop.aspectj.HystrixCommandAspect
前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家。点击跳转到教程。
1. 场景,springcloud 学习工程中,把 feign 和 ribbon 工程 作为应用服务,纳入 hystrix-turbine 服务监控中。
2. feign 工程启动报错如下:
ClassNotFoundException:
com.netflix.hystrix.contrib.javanica.aop.aspectj.HystrixCommandAspect
3. 解决:
在 pom.xml 中加上依赖:
<dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-netflix-hystrix</artifactId></dependency>
此时, feign 完整依赖为:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>com.feign</groupId><artifactId>service-feign</artifactId><version>0.0.1-SNAPSHOT</version><packaging>jar</packaging><name>service-feign</name><description>服务消费 feign 方式</description><parent><groupId>com.base</groupId><artifactId>base-config</artifactId><version>0.0.1-SNAPSHOT</version></parent><dependencies><!-- 开启 hystrix 监控 --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-actuator</artifactId></dependency><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-netflix-hystrix</artifactId></dependency><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-netflix-eureka-client</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-openfeign</artifactId></dependency></dependencies><repositories><repository><id>spring-milestones</id><name>Spring Milestones</name><url>https://repo.spring.io/milestone</url><snapshots><enabled>false</enabled></snapshots></repository></repositories></project>
4. 启动工程成功。
-------------------------------------------------------------------
PS: springcloud 系列文章见:一看就懂的springCloud系列
解决:ClassNotFoundException: com.netflix.hystrix.contrib.javanica.aop.aspectj.HystrixCommandAspect相关推荐
- 在Spring中使用Netflix Hystrix批注
除了在主页上引述之外,我想不出更好的方式来描述Netflix Hystrix库的特定功能: 延迟和容错方式: 停止级联故障. 后备和正常降级. 无法快速快速恢复. 使用断路器隔离线程和信号量. 我看到 ...
- SpringCloud Netflix Hystrix
文章目录 一. Hystrix简介 1 什么是灾难性雪崩效应 2 什么是Hystrix 二. 服务降级(Ribbon中) 三. 服务熔断(Ribbon中)(服务降级的强化版) 四. 请求缓存(Ribb ...
- Spring Cloud Netflix Hystrix介绍和使用
前面我们搭建了具有服务降级功能的Hystrix客户端,现在我们来详细了解下Hystrix的一些功能. Hystrix的意思是豪猪,大家都知道,就是长满刺的猪...实际上,它表明了该框架的主要功能:自我 ...
- Spring cloud报错com.netflix.hystrix.exception.HystrixRuntimeException
现象 生产环境,接口调用失败 feign客户端接口访问超时 查看服务正常,没有报错日志 仔细看了下,没有日志,应该是请求没有到达feign服务提供者 部分日志如下: com.netflix.hystr ...
- Netflix Hystrix断路器简介与工作原理
一.前言? 1.Netflix Hystrix断路器是什么? Netflix Hystrix是SOA/微服务架构中提供服务隔离.熔断.降级机制的工具/框架.Netflix Hystrix是断路器的一种 ...
- com.netflix.hystrix.exception.HystrixRuntimeException
com.netflix.hystrix.exception.HystrixRuntimeException 关于Hystrix因超时导致的熔断,主要检查hystrix和ribbon两项配置 hystr ...
- com.netflix.hystrix.exception.HystrixRuntimeException总结
com.netflix.hystrix.exception.HystrixRuntimeException: PolicyFeignClient#getAgentFriend(List) failed ...
- 关于 Spring AOP (AspectJ) 你该知晓的一切
[版权申明]未经博主同意,谢绝转载!(请尊重原创,博主保留追究权) http://blog.csdn.net/javazejian/article/details/54629058 出自[zejian ...
- Spring AOP + AspectJ Annotation Example---reference
In this tutorial, we show you how to integrate AspectJ annotation with Spring AOP framework. In simp ...
最新文章
- Android 使用CornerPathEffect绘制圆角矩形
- 秒杀苹果carplay baidu车联网API冷艳北京车展
- 为什么不使用volatile,其它线程也能得到当前线程修改后的值,不使用volatile也不存在可见性问题?原来解决可见性问题不一定需要volatile,println也可以
- VTK:图片之ImageRotate
- AUTOSAR从入门到精通100讲(二十)-特斯拉、高通、华为AI处理器深度分析
- python图灵测试_最前沿:基于GAN和RL的思想来训练对话生成,通过图灵测试可期!...
- php如何处理查询请求,PHP如何处理Web请求流程
- C/C++排序算法(3)冒泡排序
- UML类图几种关系的总结,泛化 = 实现 组合 聚合 关联 依赖
- linux文件管理命令详解
- 以后所有经济时事的点评都不在这里
- XP 上金山词霸 占CPU 特别大的问题
- Unix网络编程第一卷学习总结
- 红巨星粒子插件Trapcode Suite 14.0 Win版全套中文完美汉化版
- swift 指定区域截图,自定义不规则图形截图
- html怎样把两张图片重叠6,两张照片重叠成一张-如何将两张相片重叠放在一起?...
- KWS_关键词命名+识别率和误识别率
- 分布式基础--CAP原理
- 避免我们的邮件服务器发出的邮件被当成垃圾邮件
- mysql 数据文件_mysql的数据文件