Spring Integration中的NoSuchBeanDefinitionException

时间:2013-06-24 10:35:39

标签: xml spring-integration

我有一个Spring Integration Application,其中包含以下设置。

<int:gateway id="person" service-interface="<package.name>.service.PersonService">
    <int:method name="selectFromPerson"
                request-channel="selectRequestChannel"
                request-timeout="5000"
                reply-channel="selectResponseChannel"
                reply-timeout="5000"/>  
    <int:method name="insertIntoEXPerson"
                request-channel="insertRequestChannel"                  
                request-timeout="5000"
                reply-channel="insertResponseChannel"
                reply-timeout="5000"/>                              
</int:gateway>

后来 在Java代码中的某些地方,我正在编写

final AbstractApplicationContext context =
                new ClassPathXmlApplicationContext("classpath:META-INF/spring/integration/*-context.xml");

context.registerShutdownHook();
final PersonService personService = context.getBean(PersonService.class);

当我尝试在WINDOWS上运行此应用程序时,它工作得非常好但在UNIX框中它没有运行并显示在下面错误。

 org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [<package.name>.service.PersonService] is defined: expected single bean but found 0: 

任何想法我怎样才能在UNIX上运行它?

0 个答案:

没有答案