The prefix "tx" for element "tx:advice" is not bound
這個錯誤的原因很簡單是:
我們在定義申明AOP的時候。。沒有加載schema。
<beans>中要加入“xmlns:aop”的命名申明,並在“xsi:schemaLocation”中指定aop配置的schema的地址
配置文件如下:
<?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 ">