title: Spring Component Scan the classes from a jar?
body: <p>Can we generate classes with Spring Bean annotation as jar file?
  How to inject another Spring Bean from the class of that jar?
  Can you provide the possible way? When I get as below it does not work?</p>
  
  <p>In Jar File</p>
  
  <pre><code>    package org.java.support;
  
      @Service("CommonService")
      public class CommonService {
      }
  </code></pre>
  
  <p>In project</p>
  
  <pre><code>    package com.java.test.app;
  
      @Service(value = "OtherService")
      public class OtherService {
          @Resource(name = "CommonService")
          private CommonService service;
      }       
  </code></pre>
  
  <p>In configuraiton</p>
  
  <pre><code>    &lt;context:component-scan base-package="com.java.test.app, org.java.support"&gt;
          &lt;context:exclude-filter type="annotation" expression="org.springframework.stereotype.Repository"/&gt;
      &lt;/context:component-scan&gt;
  </code></pre>
  
  <p>I get the following error;</p>
  
  <pre><code>13:32:12,331 DEBUG [org.springframework.context.annotation.AnnotationConfigApplicationContext] Unable to locate LifecycleProcessor with name 'lifecycleProcessor': using default [or
  g.springframework.context.support.DefaultLifecycleProcessor@32dcb03b]
  13:32:12,331 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] Returning cached instance of singleton bean 'lifecycleProcessor'
  Exception in thread "main" org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'CommonService' is defined
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:529)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1095)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:277)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
      at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1093)
      at org.ace.java.support.delete.Test.main(Test.java:18)
  </code></pre>