1717package org .springframework .integration .aop ;
1818
1919import org .springframework .aop .framework .autoproxy .AbstractBeanFactoryAwareAdvisingPostProcessor ;
20- import org .springframework .beans .factory .BeanCreationNotAllowedException ;
20+ import org .springframework .beans .factory .BeanCreationException ;
2121import org .springframework .beans .factory .BeanFactory ;
2222import org .springframework .beans .factory .BeanNameAware ;
2323import org .springframework .beans .factory .InitializingBean ;
@@ -44,7 +44,7 @@ public class PublisherAnnotationBeanPostProcessor extends AbstractBeanFactoryAwa
4444
4545 private String defaultChannelName ;
4646
47- private String name ;
47+ private String beanName ;
4848
4949 private BeanFactory beanFactory ;
5050
@@ -60,7 +60,7 @@ public void setDefaultChannelName(String defaultChannelName) {
6060
6161 @ Override
6262 public void setBeanName (String name ) {
63- this .name = name ;
63+ this .beanName = name ;
6464 }
6565
6666 @ Override
@@ -74,16 +74,15 @@ public void setBeanFactory(BeanFactory beanFactory) {
7474 }
7575
7676 @ Override
77- public void afterPropertiesSet () throws Exception {
77+ public void afterPropertiesSet () {
7878 try {
7979 this .beanFactory .getBean (PublisherAnnotationBeanPostProcessor .class );
8080 }
8181 catch (NoUniqueBeanDefinitionException ex ) {
82- throw new BeanCreationNotAllowedException (this .name ,
82+ throw new BeanCreationException (this .beanName ,
8383 "Only one 'PublisherAnnotationBeanPostProcessor' bean can be defined in the application context." +
8484 " Do not use '@EnablePublisher' (or '<int:enable-publisher>') if you declare a" +
85- " 'PublisherAnnotationBeanPostProcessor' bean definition manually. " +
86- "Bean names found: " + ex .getBeanNamesFound ());
85+ " 'PublisherAnnotationBeanPostProcessor' bean definition manually." , ex );
8786 }
8887 }
8988
0 commit comments