title: Spring Boot @Autowire not working. Error creating bean
body: <p>Hi I have a spring boot project. The main class package is like this :</p>
  <pre><code>com.som.demo
  </code></pre>
  <p>I have used an external jar as a maven dependency in my project. In that jar there is a service class annotated with @Service as below :</p>
  <pre><code>@Service
  public class SomeServiceImpl implements SomeService {
        @Autowired
        private TreeCacheWrapper ffCoreCache;
  
        @Autowired(required = false)
        private ZookeeperProperties zookeeperProperties;
  
        public SomeServiceImpl(TreeCacheWrapper ffCoreCache, ZookeeperProperties zookeeperProperties) {
           this.ffCoreCache = ffCoreCache;
           this.zookeeperProperties = zookeeperProperties;
        }
  }
  </code></pre>
  <p>And the main package where this <code>SomeServiceImpl</code>  class is as below :</p>
  <pre><code>com.som.test
  </code></pre>
  <p>Now in my project when I am autowiring the class I get the bean creation error while running the spring boot app. This is how I am doing :</p>
  <pre><code>@Autowired
  private SomeService someService;
  </code></pre>
  <p><strong>Error</strong> :</p>
  <pre><code> org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'someServiceImpl'
  Unsatisfied dependency expressed through field 'ffCoreCache'; 
  nested exception is org.springframework.beans.factory.BeanCreationException: 
  Error creating bean with name 'ffCoreCache' defined in class path resource [com/som/test/config/ZooKeeperConfig.class]: 
  Bean instantiation via factory method failed; 
  nested exception is org.springframework.beans.BeanInstantiationException: 
  Failed to instantiate [com.som.test.cache.TreeCacheWrapper]: 
  Factory method 'ffCoreCache' threw exception; 
  nested exception is java.lang.NoClassDefFoundError: org/apache/curator/retry/ExponentialBackoffRetry
  
  
  Caused by: org.springframework.beans.factory.BeanCreationException: 
  Error creating bean with name 'ffCoreCache' defined in class path resource [com/som/test/config/ZooKeeperConfig.class]: 
  Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: 
  Failed to instantiate [com.som.test.cache.TreeCacheWrapper]: 
  Factory method 'ffCoreCache' threw exception; nested exception is java.lang.NoClassDefFoundError: org/apache/curator/retry/ExponentialBackoffRetry
  
  
  
  Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.som.test.cache.TreeCacheWrapper]: 
  Factory method 'ffCoreCache' threw exception; nested exception is java.lang.NoClassDefFoundError: org/apache/curator/retry/ExponentialBackoffRetry
  
  Caused by: java.lang.NoClassDefFoundError: org/apache/curator/retry/ExponentialBackoffRetry
  
  Caused by: java.lang.ClassNotFoundException: org.apache.curator.retry.ExponentialBackoffRetry
  </code></pre>