The following pom.xml has been working fine:
<?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>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.5.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<!-- project info-->
...
<properties>
<java.version>1.8</java.version>
<spring-cloud.version>Finchley.RELEASE</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Soon I upgraded boot parent version to 2.1.4.RELEASE, things start breaking, saying cannot find aspectj
[ERROR] Error creating bean with name 'hystrixCommandAspect' defined in class path resource [org/springframework/cloud/netflix/hystrix/HystrixCircuitBreakerConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.netflix.hystrix.contrib.javanica.aop.aspectj.HystrixCommandAspect]: Factory method 'hystrixCommandAspect' threw exception; nested exception is java.lang.NoClassDefFoundError: org/aspectj/lang/JoinPoint: org.aspectj.lang.JoinPoint -> [Help 1]
So yes, if I put in this, things are good again:
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.9.3</version>
</dependency>
My enquiry is not how to solve this particular problem, but should this manual dependency resolution expected ? I mean, for example, if later there is a Boot 2.2.0 release, one would expect some other similar resolution may be (or may be not) required for thing to work ? Or the dependency management should be already thought out and it's a case of something wrong from my environment ?
Thanks,
Comment From: spencergibb
Did you update to Greenwich as well?
Comment From: tvdinh
@spencergibb Yes, I did. Tried both Greenwich.RELEASE and Greenwich.SR1. Same issue.
Comment From: Haybu
This issue is not reproducible. Boot 2.1.4.RELEASE + SC Finchley.RELEASE combination does not throw the above mentioned exception for me.
Comment From: spencergibb
Can you provide a complete, minimal, verifiable sample that reproduces the problem? It should be available as a GitHub (or similar) project or attached to this issue as a zip file.
Comment From: tvdinh
Not exactly minimal, but hope this would work: https://github.com/tvdinh/spring-hystrix-demo Simply clone, and run "mvn clean install"
Comment From: Haybu
mvn clean install runs successfully on the provided sample. The provided sample depends on a computation service to invoke, therefore I won't be able to run it.
I put together for you the attached typical simple sample that works with same boot version 2.1.4.RELEASE and SC version Finchley.RELEASE.
Comment From: tvdinh
@Haybu : Thanks Haybu, turned out it is the issue with my local maven repo. aspectj 1.9.2 is corrupted. It's all good now. Closing the ticket. Thanks.
Comment From: vishnu-20
how to solve this issue?
Comment From: ryanjbaxter
Please open a separate issue with a description of the problem and a sample that reproduces the problem