use of org.springframework.beans.factory.BeanCreationException in project spring-integration by spring-projects.
the class GatewayMessageHandler method initialize.
private void initialize() {
BeanFactory beanFactory = getBeanFactory();
if (beanFactory instanceof ConfigurableListableBeanFactory) {
((ConfigurableListableBeanFactory) beanFactory).initializeBean(this.gatewayProxyFactoryBean, null);
}
try {
this.exchanger = (RequestReplyExchanger) this.gatewayProxyFactoryBean.getObject();
} catch (Exception e) {
throw new BeanCreationException("Can't instantiate the GatewayProxyFactoryBean: " + this, e);
}
if (this.running) {
// We must stop gatewayProxyFactoryBean because after the normal start its "gatewayMap" is still empty
this.gatewayProxyFactoryBean.stop();
this.gatewayProxyFactoryBean.start();
}
}
use of org.springframework.beans.factory.BeanCreationException in project spring-integration by spring-projects.
the class MessagingAnnotationsWithBeanAnnotationTests method testInvalidMessagingAnnotationsConfig.
@Test
public void testInvalidMessagingAnnotationsConfig() {
try {
new AnnotationConfigApplicationContext(InvalidContextConfiguration.class).close();
fail("BeanCreationException expected");
} catch (Exception e) {
assertThat(e, instanceOf(BeanCreationException.class));
assertThat(e.getCause(), instanceOf(BeanDefinitionValidationException.class));
assertThat(e.getMessage(), containsString("The attribute causing the ambiguity is: [applySequence]."));
}
}
use of org.springframework.beans.factory.BeanCreationException in project spring-integration by spring-projects.
the class AggregatorParserTests method testMissingReleaseStrategyDefinition.
@Test
public void testMissingReleaseStrategyDefinition() {
try {
new ClassPathXmlApplicationContext("ReleaseStrategyMethodWithMissingReference.xml", this.getClass()).close();
fail("Expected exception");
} catch (BeanCreationException e) {
assertThat(e.getMessage(), containsString("No bean named 'testReleaseStrategy' available"));
}
}
use of org.springframework.beans.factory.BeanCreationException in project spring-integration by spring-projects.
the class AggregatorParserTests method testAggregatorWithInvalidReleaseStrategyMethod.
@Test
public void testAggregatorWithInvalidReleaseStrategyMethod() {
try {
new ClassPathXmlApplicationContext("invalidReleaseStrategyMethod.xml", this.getClass()).close();
fail("Expected exception");
} catch (BeanCreationException e) {
assertThat(e.getMessage(), containsString("TestReleaseStrategy] has no eligible methods"));
}
}
use of org.springframework.beans.factory.BeanCreationException in project spring-integration by spring-projects.
the class AggregatorParserTests method testMissingMethodOnAggregator.
@Test
public void testMissingMethodOnAggregator() {
try {
new ClassPathXmlApplicationContext("invalidMethodNameAggregator.xml", this.getClass()).close();
fail("Expected exception");
} catch (BeanCreationException e) {
assertThat(e.getMessage(), containsString("Adder] has no eligible methods"));
}
}
Aggregations