解决:ClassNotFoundException: com.netflix.hystrix.contrib.javanica.aop.aspectj.HystrixCommandAspect
生活随笔
收集整理的這篇文章主要介紹了
解决:ClassNotFoundException: com.netflix.hystrix.contrib.javanica.aop.aspectj.HystrixCommandAspect
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
前些天發(fā)現(xiàn)了一個巨牛的人工智能學(xué)習(xí)網(wǎng)站,通俗易懂,風(fēng)趣幽默,忍不住分享一下給大家。點(diǎn)擊跳轉(zhuǎn)到教程。
1. 場景,springcloud 學(xué)習(xí)工程中,把 feign 和 ribbon 工程 作為應(yīng)用服務(wù),納入 hystrix-turbine 服務(wù)監(jiān)控中。
2. feign 工程啟動報錯如下:
ClassNotFoundException: com.netflix.hystrix.contrib.javanica.aop.aspectj.HystrixCommandAspect3. 解決:
在 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>服務(wù)消費(fèi) feign 方式</description><parent><groupId>com.base</groupId><artifactId>base-config</artifactId><version>0.0.1-SNAPSHOT</version></parent><dependencies><!-- 開啟 hystrix 監(jiān)控 --><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系列?
總結(jié)
以上是生活随笔為你收集整理的解决:ClassNotFoundException: com.netflix.hystrix.contrib.javanica.aop.aspectj.HystrixCommandAspect的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: MFC的框架程序分析3
- 下一篇: MFC框架结构简述