SSH 통합 문제: The prefix "tx" for element "tx: annotation - driven" is not bound

1951 단어 xmlSSH 통합
오늘 설정 spring 은 tx: annotation - driven is not bound 문제 에 부 딪 혔 습 니 다. 인터넷 에서 찾 아 보 았 습 니 다. 특별히 기록 하 였 습 니 다.
http://blog.csdn.net/gabriel80/archive/2008/05/29/2492608.aspx
The prefix "tx" for element "tx:advice" is not bound
이 잘못된 원인 은 매우 간단 하 다.
우리 가 AOP 를 정의 할 때schema 를 불 러 오지 않 았 습 니 다.
구체 적 인 표현 은 다음 과 같다.
<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    -->   
<aop:config proxy-target-class="true">   
....
</aop:config>
</beans>

이 때 < TX > 를 알 아 보지 못 하 는 이상 한 탭 을 던 집 니 다.처음에는 JAR 가방 을 안 넣 은 줄 알 았 는데.
나중에 AOP 문 서 를 읽 고 나 서 야 < beans > 에 "xmlns: aop" 의 이름 을 추가 하고 "xsi: schema Location" 에서 op 설정 의 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">

이것 이 야 말로 가장 중요 한 곳 이다.뒤의 설정 은 변 하지 않 습 니 다...

좋은 웹페이지 즐겨찾기