Note that there are some explanatory texts on larger screens.

plurals
  1. POSpring 3.0 annotation bean Component Scan
    primarykey
    data
    text
    <p>How to do <code>component-scan</code> in spring 3.0? I use annotation like @Service, @Reponsity for both jar and project. It does not work. When the bean in project inject from the bean in jar.</p> <p>In jar file</p> <pre><code> com.java.spring.support </code></pre> <p>In project </p> <pre><code> org.me.project </code></pre> <p>My configuration is</p> <pre><code> &lt;context:annotation-config/&gt; &lt;context:component-scan base-package="com.java.spring.support, org.me.project"/&gt; </code></pre> <p>In Jar File</p> <pre><code> package com.java.spring.support; @Service("CommonService") public class CommonService { } </code></pre> <p>In project</p> <pre><code> package org.me.project; @Service(value = "OtherService") public class OtherService { @Resource(name = "CommonService") private CommonService service; } </code></pre> <p>I get error</p> <pre><code> 15:41:53,043 DEBUG [org.springframework.context.support.ClassPathXmlApplicationContext] Unable to locate LifecycleProcessor with name 'lifecycleProcessor': using default [org.sprin gframework.context.support.DefaultLifecycleProcessor@510ebe18] 15:41:53,044 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:13) </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload