Can some one kindly offer some help?
Run into NoSuchMethodError when load ApplicatioonContext in unit test.
Use springframework.integration-1.0.0 and spring-framework-2.5.6.
I do have org.springframework.integration.stream-1.0.0.RELEASE.jar in classpath
The exception trace:
org.springframework.beans.factory.parsing.BeanDefi nitionParsingException: Configuration problem: Failed to import bean definitions from URL location[classpath*:/applicationContext.xml] Offending resource: file[C:\...\applicationContext.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionSt oreException: Unexpected exception parsing XML document from URL [file:/applicationContext.xml]; nested exception is java.lang.NoSuchMethodError: org/springframework/beans/factory/support/BeanDefinitionBuilder.genericBeanDefinition(Ljava/lang/ClassLorg/springframework/beans/factory/support/
BeanDefinitionBuilder;
It is a very simple test
public class TrialSpringIntegrationTest extends AbstractSingleSpringContextTests
{
private TrialService trialService;
public void setTrialService(TrialService trialService)
{
this.trialService = trialService;
}
protected String[] getConfigLocations()
{
return "file:/applicationContext.xml",
}
public void testTimeRequest() throws Exception
{
Object obj = this.trialService.getTrialResult();
assertNotNull(obj);
}
}
ApplicationContext xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns=".../schema/integration"
xmlns:xsi=".../XMLSchema-instance"
xmlns:beans=".../schema/beans"
xmlns:stream=".../integration/stream"
xsi:schemaLocation=".../beans
.../spring-beans-2.5.xsd
.../integration
.../integration/springintegration-1.0.xsd
.../integration/stream
.../stream/spring-integration-stream-1.0.xsd">
<channel id="out_trial" />
<channel id="in_trial" />
<queue capacity="10"/>
</channel>
<service-activator input-channel="in_trial" ref="trialService" method="getTrialResult" output-channel="out_trial"/>
<beans:bean id="trialService" class="com.xxx.xxx.TrialService"/>
</beans:beans>


Lorg/springframework/beans/factory/support/
Reply With Quote