0

I am trying to create a simple Hystrix Application, I have added the maven dependencies and it's throws an below error,

    Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/boot/Banner$Mode
    at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:162)
    at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:102)
    at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:68)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:151)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:128)
    at org.springframework.boot.context.event.EventPublishingRunListener.publishEvent(EventPublishingRunListener.java:100)
    at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:59)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:285)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:957)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:946)
    at com.hp.it.sadb.telepathy.Main.main(Main.java:80)
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.Banner$Mode
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 11 more

Below is my maven dependencies :

<dependency>
   <groupId>org.springframework.cloud</groupId>
   <artifactId>spring-cloud-starter-hystrix</artifactId>
   <version>1.4.6.RELEASE</version>
</dependency>

<dependency>
    <groupId>com.netflix.hystrix</groupId>
    <artifactId>hystrix-javanica</artifactId>
    <version>RELEASE</version>
</dependency>
<dependency>
    <groupId>com.netflix.hystrix</groupId>
    <artifactId>hystrix-core</artifactId>
    <version>RELEASE</version>
</dependency>
<dependency>
    <groupId>com.netflix.hystrix</groupId>
    <artifactId>hystrix-metrics-event-stream</artifactId>
    <version>RELEASE</version>
</dependency>

Can anyone tell me, how to resolve the issue and create a simple hystrix application?

Thiru
  • 11
  • 1
  • 4
  • Does this answer your question? [java.lang.ClassNotFoundException: org.springframework.boot.SpringApplication Maven](https://stackoverflow.com/questions/20740703/java-lang-classnotfoundexception-org-springframework-boot-springapplication-mav) – PythonLearner Nov 17 '19 at 18:21

1 Answers1

0
<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>

Please follow below link for Sample Hystix Application.

https://howtodoinjava.com/spring-cloud/spring-hystrix-circuit-breaker-tutorial/
sai
  • 111
  • 1
  • 3