Spring 弹簧AOP误差

Spring 弹簧AOP误差,spring,aop,spring-aop,Spring,Aop,Spring Aop,在运行时,什么会导致此问题 匹配的通配符是严格的,但是 找不到的声明 元素“aop:config” 以下是相关的Spring XML: <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/ut

在运行时,什么会导致此问题

匹配的通配符是严格的,但是 找不到的声明 元素“aop:config”

以下是相关的Spring XML:

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:util="http://www.springframework.org/schema/util"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
       http://www.springframework.org/schema/util
       http://www.springframework.org/schema/util/spring-util-2.0.xsd
       http://www.springframework.org/schema/aop
       http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
    .
    .
    .
    <aop:config>
        <aop:advisor pointcut="execution(* acme.exam.driver.ui.components..*(..))" 
                     advice-ref="loggingInterceptor" />
    </aop:config>

    <bean id="loggingInterceptor" 
          class="org.springframework.aop.interceptor.CustomizableTraceInterceptor">
        <property name="enterMessage" 
                  value="ENTER: $[targetClassShortName].$[methodName]($[arguments])" />
        <property name="exitMessage" 
                  value="EXIT: $[targetClassShortName].$[methodName]($[arguments]) = $[returnValue])" />
    </bean>
</beans>

.
.
.

注意,我已经将aspectjweaver.jar和aspectjrt.jar放在类路径上。

您在类路径上仔细检查了spring aop工件了吗


根据我的maven依赖项,aspectjweaver是不够的,我还需要aspectjrt。

确保
/dist/modules/spring aop.jar
在类路径中。

对于其他人,我在配置中解决了这个错误,其中名称空间包含该项

xmlns:aop="http://www.springframework.org/schema/aop
虽然没有包含xsi:schemaLocation元素

此配置错误导致出现上述消息。

添加schemaLocation元素解决了这个问题。

什么是“spring aop工件”?您似乎找到了工件名称:-)
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd