Spring: Properly setup @ComponentScan
问题 I have following set up for my Spring Application Context . @Configuration public class RmiContext { @Bean public RmiProxyFactoryBean service() { RmiProxyFactoryBean rmiProxy = new RmiProxyFactoryBean(); rmiProxy.setServiceUrl("rmi://127.0.1.1:1099/Service"); rmiProxy.setServiceInterface(Service.class); return rmiProxy; } } @Configuration public class LocalContext { @Bean public Controller Controller() { return new ControllerImpl(); } } @Configuration @Import({RmiContext.class, LocalContext