Spring AOP实现 日志记录 XML 文件如何 配置

![图片说明](https://img-ask.csdn.net/upload/201706/02/1496340008_847020.png)图片说明
现在AOP 能实现 但是 controller 里面的都失效了

2017-06-02 01:58:41,786 [org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping]-[DEBUG] Rejected bean name 'monograph_typeController': no URL paths identified
2017-06-02 01:58:41,786 [org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping]-[DEBUG] Rejected bean name 'paperController': no URL paths identified
2017-06-02 01:58:41,786 [org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping]-[DEBUG] Rejected bean name 'paper_authorController': no URL paths identified
2017-06-02 01:58:41,787 [org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping]-[DEBUG] Rejected bean name 'patent_stateController': no URL paths identified
2017-06-02 01:58:41,787 [org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping]-[DEBUG] Rejected bean name 'research_directionController': no URL paths identified
2017-06-02 01:58:41,787 [org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping]-[DEBUG] Rejected bean name 'safetyController': no URL paths identified
2017-06-02 01:58:41,787 [org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping]-[DEBUG] Rejected bean name 'systemLogController': no URL paths identified
2017-06-02 01:58:41,787 [org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping]-[DEBUG] Rejected bean name 'task_flowController': no URL paths identified
2017-06-02 01:58:41,788 [org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping]-[DEBUG] Rejected bean name 'userController': no URL paths identified
2017-06-02 01:58:41,788 [org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping]-[DEBUG] Rejected bean name 'user_roleController': no URL paths identified
2017-06-02 01:58:41,788 [org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping]-[DEBUG] Rejected bean name 'yearController': no URL paths identified
日志报错 所有的地址都失效了

在aop配置文件里把spring组件扫描配置上试试

包扫描scan配置的有问题,没生效

controller类加了@Controller的注解了没,或者在xml中配置了对应了bean了吗

第八行 spring-beans.xsd 少了版本号。
应该是 spring-beans-4.1.xsd

最好是配置一个本地映射

Window--Preferences 搜索xml
里面有一个全是链接的 点add添加
1.选择spring-beans-4.1.xml原文件
2.下拉框选择第二项
3.把第八行空格后面那段字符串粘贴进去
ok

还是不行啊 求大神 给个 配置源码 看看 XML就行

图片说明

Location: 是spring-beans-4.3.xsd文件的本地地址

KeyType: 选Schema Location

Key: 也就是xml映射的后面那段,都配上吧
http://www.springframework.org/schema/beans/spring-beans-4.3.xsd