首页 > 其他 > 详细

Only one AsyncAnnotationBeanPostProcessor may exist within the context.

时间:2016-05-12 16:09:57      阅读:677      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!