One asyncannotationbeanpostprocessor may exist within the context.

Source: Internet
Author: User

I had this problem when I copied applicationContext.xml and created new one called applicationContextAdditional.xml. I did n‘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.

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> appears twice.

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 /> appears twice.
Only one AsyncAnnotationBeanPostProcessor may exist within the context.

label:

Original address: http://blog.csdn.net/liyanlei5858/article/details/51361268

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.