Java @Autowired不适用于外部应用程序

Java @Autowired不适用于外部应用程序,java,spring,spring-mvc,spring-security,Java,Spring,Spring Mvc,Spring Security,我有两个应用程序,例如app1和app2。我正在app1中使用app2的jar。app2有一个服务接口,其实现在app1中。我想将app1的serviceImpl注入app2。但它不适用于注释。但它使用的是xml文件条目。我还添加了xml格式的app2组件扫描。请帮帮我 附录2: 附录2: 例外情况: Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: priv

我有两个应用程序,例如app1和app2。我正在app1中使用app2的jar。app2有一个服务接口,其实现在app1中。我想将app1的serviceImpl注入app2。但它不适用于注释。但它使用的是xml文件条目。我还添加了xml格式的app2组件扫描。请帮帮我

附录2:

附录2:

例外情况:

Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private xx.generator.InterTransactionService xx.generator.ETLImpl.interTransactionService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [xx.generator.InterTransactionService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Qualifier(value=interTransactionService), @org.springframework.beans.factory.annotation.Autowired(required=true)}

这个问题以目前的形式无法回答。请您添加一个相关代码来说明问题?组件扫描是否拾取了
ETLImpl
所在的包?另外,您是否可以添加有效的
XML
,并添加您看到的错误,或者只是因为App2 interTransactionService为空?是的,组件扫描正在提取ETLImpl包的基础。
@Service("interTransactionService")
public class InterTransactionServiceImpl implements InterTransactionService{
//implementation of methods
}
@Service
@Scope(value=BeanDefinition.SCOPE_PROTOTYPE,proxyMode=ScopedProxyMode.TARGET_CLASS)
public class ETLImpl extends AbstractInstanceGeneratorService{

    @Qualifier("interTransactionService")
    @Autowired
    private InterTransactionService interTransactionService;
}
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private xx.generator.InterTransactionService xx.generator.ETLImpl.interTransactionService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [xx.generator.InterTransactionService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Qualifier(value=interTransactionService), @org.springframework.beans.factory.annotation.Autowired(required=true)}