Description of the prefix "TX" for Element "Tx:advice" are not bound error

Source: Internet
Author: User
Tags aop

The prefix "TX" for Element "Tx:advice" are not bound

The reason for this error is very simple:

When we define AOP, we ... Schema not loaded.

The specific performance is as follows:

<beans>

<tx:advice id= "Txadvice" transaction-manager= "TransactionManager" >
<tx:attributes>
<tx:method name= "get*" read-only= "true"/>
<tx:method name= "*" propagation= "requires_new" rollback-for= "Exception"/>
</tx:attributes>
</tx:advice>

<!--AOP proxy settings-->
<aop:config proxy-target-class= "true" >
....

</aop:config>

</beans>

The exception will be thrown without recognition <TX> label. At first I thought I didn't load the jar bag.

Later, the AOP document was read to discover the name declaration of "XMLNS:AOP" to be added to the <beans> and to specify the address of an AOP configuration schema in "Xsi:schemalocation"

The configuration file is as follows:

<?xml version= "1.0" encoding= "UTF-8"?>
<beans xmlns= "Http://www.springframework.org/schema/beans"
Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop= "HTTP://WWW.SPRINGFRAMEWORK.ORG/SCHEMA/AOP"
xmlns:tx= "Http://www.springframework.org/schema/tx"
Xsi:schemalocation= "Http://www.springframework.org/schema/beans
Http://www.springframework.org/schema/beans/spring-beans.xsd
Http://www.springframework.org/schema/tx
Http://www.springframework.org/schema/tx/spring-tx.xsd
Http://www.springframework.org/schema/aop
Http://www.springframework.org/schema/aop/spring-aop.xsd ">

These are the most important places. The following configuration does not change ....

Hope to help others solve this kind of small problem

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.