title: Hystrix Javanica : Call always returning result from fallback method.(java web app without spring)
body: <p>I am trying to integrate Hystrix javanica into my existing java EJB web application and facing 2 issues with running it.</p>
  
  <ol>
  <li><p>When I try to invoke following service it always returns response from fallback method and I see that the Throwable object in fallback method has "com.netflix.hystrix.exception.HystrixTimeoutException" exception.</p></li>
  <li><p>Each time this service is triggered, HystrixCommad and fallback methods are called multiple times around 50 times.</p></li>
  </ol>
  
  <p>Can anyone suggest me with any inputs? Am I missing any configuration?  </p>
  
  <p>I am including following libraries in my project.
  <a href="https://i.stack.imgur.com/EWujI.png" rel="nofollow noreferrer">project libraries</a></p>
  
  <p>I have setup my aspect file as follows:</p>
  
  <pre><code>&lt;aspectj&gt;
   &lt;weaver options="-verbose -showWeaveInfo"&gt;&lt;/weaver&gt;
   &lt;aspects&gt;
      &lt;aspect name="com.netflix.hystrix.contrib.javanica.aop.aspectj.HystrixCommandAspect"/&gt;
   &lt;/aspects&gt;
  &lt;/aspectj&gt;
  </code></pre>
  
  <p>Here is my config.properties file in META-INF/config.properties</p>
  
  <pre><code>hystrix.command.default.execution.timeout.enabled=false
  </code></pre>
  
  <p>Here is my rest service file</p>
  
  <pre><code>@Path("/hystrix")
  public class HystrixService {
  
   @GET
   @Path("clusterName")
   @Produces({ MediaType.APPLICATION_JSON })
   public Response getClusterName(@QueryParam("id") int id) {
      ClusterCmdBean clusterCmdBean = new ClusterCmdBean();
      String result = clusterCmdBean.getClusterNameForId(id);
      return Response.ok(result).build();
   }
  }
  </code></pre>
  
  <p>Here is my bean class</p>
  
  <pre><code>public class ClusterCmdBean {
  
   @HystrixCommand(groupKey = "ClusterCmdBeanGroup", commandKey = "getClusterNameForId", fallbackMethod = "defaultClusterName")
   public String getClusterNameForId(int id) {
      if (id &gt; 0) {
          return "cluster"+id;
      } else {
          throw new RuntimeException("command failed");
      }
   }
  
   public String defaultClusterName(int id, Throwable e) {
      return "No cluster - returned from fallback:" + e.getMessage();
   }
  }
  </code></pre>
  
  <p>Thanks for the help.</p>