Dòng 13 trong tài liệu XML từ tài nguyên đường dẫn lớp [ApplicationContextAOP.xml] không hợp lệ; ngoại lệ lồng nhau là org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: Ký tự đại diện phù hợp là nghiêm ngặt, nhưng không thể khai báo cho phần tử 'aop: config'.Spring AOP Ký tự đại diện phù hợp là nghiêm ngặt, nhưng không thể khai báo cho phần tử 'aop: config'
<?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:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<bean id="audience" class="com.idol.Audience" />
<aop:config>
<aop:aspect ref="audience">
<!-- Before performance -->
<aop:before pointcut="execution(*com.idol.performers.Performer.perform(..))"
method="takeSeats"/>
<aop:before pointcut="execution(*com.idol.performers.Performer.perform(..))"
method="turnOffCellPhones" />
<!-- After performance -->
<aop:after-returning pointcut="execution(*com.idol.performers.Performer.perform(..))"
method="applaud" />
<!-- After bad performance(exception thrown) -->
<aop:after-throwing pointcut="execution(*com.idol.performers.Performer.perform(..))"
method="demandRefund" />
</aop:aspect>
</aop:config>
<bean id="poeticDuke" class="com.idol.performers.PoeticJuggler">
<constructor-arg value = "15" />
<constructor-arg ref = "sonnet29" />
</bean>
</beans>
Tôi đã nhìn thấy lỗi tương tự và tôi khá chắc chắn classpath của tôi có org.springframework.aop-3.1.0.M2.jar
Ông có thể cho tôi biết những gì xin vui lòng pm Tôi bị mất?
Cảm ơn bạn rất nhiều vì câu hỏi của bạn. Tôi đã phải đối mặt với cùng một vấn đề, nhưng trong trường hợp của tôi vấn đề là tôi đã thiếu 'spring-aop.jar' trong classpath; đó là những gì tôi đã mất tích. Cảm ơn vì đã chú ý đến điều đó. – manuelvigarcia