Spring's @Scheduled error : Only one AsyncAnnotationBeanPostProcessor may exist within the context

后端 未结 7 1678
梦毁少年i
梦毁少年i 2020-12-06 04:50

I am trying Spring 3\'s @Scheduled annotation . Here is my configuration (app.xml) :




        
7条回答
  •  离开以前
    2020-12-06 05:10

    The application context is being initialized twice but org.springframework.scheduling.config.AnnotationDrivenBeanDefinitionParser fails registering bean ASYNC_ANNOTATION_PROCESSOR_BEAN_NAME second time.

    I encountered this problem in unit tests where @ContextConfiguration("/path/to/applicationContext.xml") was accidentally on both the parent test class and child test class (with default value of inheritLocations true).

提交回复
热议问题