gloomysnow 2015-09-27 15:37 采纳率: 62.5%
浏览 4418

初学者spring aop/tx配置出现问题不会

图片说明

错误信息:
Multiple annotations found at this line:
- schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/context/spring-beans.xsd', because 1) could not find the document; 2) the document could
not be read; 3) the root element of the document is not xsd:schema.
- cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'context:annotation-config'.

Multiple annotations found at this line:
- schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/tx/spring-beans.xsd', because 1) could not find the document; 2) the document could not be 
 read; 3) the root element of the document is not <xsd:schema>.
- cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'tx:advice'.
  • 写回答

2条回答 默认 最新

  • Evankaka 领域专家: 后端开发技术领域 2015-09-27 15:46
    关注

    前面引用的改写成下面试试

     <?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:context="http://www.springframework.org/schema/context"  
        xmlns:aop="http://www.springframework.org/schema/aop"  
        xsi:schemaLocation="    
               http://www.springframework.org/schema/beans    
               http://www.springframework.org/schema/beans/spring-beans-3.0.xsd    
               http://www.springframework.org/schema/aop    
               http://www.springframework.org/schema/aop/spring-aop-3.0.xsd  
               http://www.springframework.org/schema/context    
               http://www.springframework.org/schema/context/spring-context-3.0.xsd">  
    
        <!-- 指定自动搜索bean组件、自动搜索切面类 -->  
            <context:component-scan base-package="com.mucfu"/>  
        <!-- 启动@AspectJ支持 -->  
        <!-- proxy-target-class默认"false",更改为"ture"使用CGLib动态代理 -->    
        <aop:aspectj-autoproxy proxy-target-class="false"/>  
    
    
    </beans>  
    

    可 以参考下我写的
    http://blog.csdn.net/evankaka/article/details/45242505

    评论

报告相同问题?