Search code examples
spring-bootspring-cloudspring-cloud-netflixhystrix

Spring Boot with Hystrix


I am using Spring Boot with Hystrix for my university project. The problem I have is when I add Netflix Hystrix dependency to pom.xml file and run the program, It throws an Error called AbstractMethodError : null, but without Netflix Hystrix dependency program runs without any error. How can I slove this?

These are my 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-dashboard</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>

Solution

  • This is due to dependency mismatch. Application is trying to call an abstractt method but it doesn't find that method. So, it is throwing the null exception.

    Use two dependency netflix-hystrix-dashboard and hystrix as below.

     <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-hystrix</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-hystrix-dashboard</artifactId>
    </dependency>