码迷,mamicode.com
首页 > 其他好文 > 详细

Only one AsyncAnnotationBeanPostProcessor may exist within the context.

时间:2016-05-12 16:10:18      阅读:1024      评论:0      收藏:0      [点我收藏+]

标签:



I had this problem when I copied applicationContext.xml and created new one called applicationContextAdditional.xml. I didn‘t try to find the reason, but both contained namespace

<bean ...
    xmlns:task="http://www.springframework.org/schema/task"
    ...
    xsi:schemaLocation="
   http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd" >

    ...

</bean>

when I removed the namespace from the second one my problem was solved. Maybe it helps someone.

红色命名空间出现2次。



I have faced this once after implementing our own AsyncTaskExecutor andforgetting to remove default <task: annotation-driven/>

Check if you have something like this, if yes remove one of the task.

<task:annotation-driven executor="customAsyncTaskExecutor" scheduler="taskScheduler"/>

<task:annotation-driven/>
<task:annotation-driven>出现两次。


This happens when spring parses the <task:annotation-driven/> text twice in a config XML.

For me this was happening because both applicationContext-root.xml and applicationContext-where-annotation-driven-is-specififed.xml were imported in my WEB.xml in <context-param>section.

Leaving only applicationContext-root.xml in WEB.xml solved the issue.


<task:annotation-driven/>出现两次。



Only one AsyncAnnotationBeanPostProcessor may exist within the context.

标签:

原文地址:http://blog.csdn.net/liyanlei5858/article/details/51361268

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!