title: Hystrix fallback method gives error
body: <p>I am trying to use Netflix Hystrix Fallbackmethod &amp; with a simple spring program. i followed all the basic steps as described in some tutorials, but still I am getting error,</p>
  
  <pre><code>org.springframework.beans.factory.BeanCreationException: 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 inst
  </code></pre>
  
  <p>Anyone know if any configuration is missing? Below is the code snippet.</p>
  
  <p>My Main,</p>
  
  <pre><code>@SpringBootApplication
  @EnableCircuitBreaker
  public class SpringBootHelloWorldApplication {
      public static void main(String[] args) {
          SpringApplication.run(SpringBootHelloWorldApplication.class, args);
      }
  }
  </code></pre>
  
  <p>My Controller,</p>
  
  <pre><code>@RestController
  @Component
  public class TestController {
  
      @RequestMapping(value = "/hello", method = RequestMethod.GET)
      @HystrixCommand(fallbackMethod="Error")
      public String Hello() {
          String text = "Hi Hello, you have come to correct place";
  
          //creating an exception to trigger fallBackMethod!!!
           if(text != "something")
              throw new RuntimeException(); 
  
          return text;
      }
  
      public String Error() {
          String text = "Error - this is an backup text";
  
          return text;
      }
  }
  </code></pre>
  
  <p>When i run my Main class, I am getting this error,</p>
  
  <pre><code>org.springframework.beans.factory.BeanCreationException: 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
      at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1128) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1023) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:751) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:861) ~[spring-context-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541) ~[spring-context-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
      at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
      at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1186) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1175) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
      at com.siddharth.SpringBootHelloWorldApplication.main(SpringBootHelloWorldApplication.java:14) [classes/:na]
  Caused by: 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
      at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      ... 18 common frames omitted
  Caused by: java.lang.NoClassDefFoundError: org/aspectj/lang/JoinPoint
      at org.springframework.cloud.netflix.hystrix.HystrixCircuitBreakerConfiguration.hystrixCommandAspect(HystrixCircuitBreakerConfiguration.java:60) ~[spring-cloud-netflix-core-1.2.6.RELEASE.jar:1.2.6.RELEASE]
      at org.springframework.cloud.netflix.hystrix.HystrixCircuitBreakerConfiguration$$EnhancerBySpringCGLIB$$8c1f134f.CGLIB$hystrixCommandAspect$2(&lt;generated&gt;) ~[spring-cloud-netflix-core-1.2.6.RELEASE.jar:1.2.6.RELEASE]
      at org.springframework.cloud.netflix.hystrix.HystrixCircuitBreakerConfiguration$$EnhancerBySpringCGLIB$$8c1f134f$$FastClassBySpringCGLIB$$af9d12ee.invoke(&lt;generated&gt;) ~[spring-cloud-netflix-core-1.2.6.RELEASE.jar:1.2.6.RELEASE]
      at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:356) ~[spring-context-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      at org.springframework.cloud.netflix.hystrix.HystrixCircuitBreakerConfiguration$$EnhancerBySpringCGLIB$$8c1f134f.hystrixCommandAspect(&lt;generated&gt;) ~[spring-cloud-netflix-core-1.2.6.RELEASE.jar:1.2.6.RELEASE]
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_112]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_112]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_112]
      at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_112]
      at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      ... 19 common frames omitted
  Caused by: java.lang.ClassNotFoundException: org.aspectj.lang.JoinPoint
      at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_112]
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_112]
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) ~[na:1.8.0_112]
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_112]
      ... 30 common frames omitted
  </code></pre>
  
  <p>My Dependencies, </p>
  
  <p><a href="https://i.stack.imgur.com/Vlr28.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Vlr28.jpg" alt="enter image description here"></a></p>