使用Aspect记录操作日志时,启动项目报以下异常:
严重: StandardWrapper.Throwable org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mvcContentNegotiationManager': Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: error Type referred to is not an annotation type: log
实现代码:
/** * 前置通知,用于拦截controller层的操作 * * @param joinPoint * @param log */ @Before("controllerAspect() && @annotation(log)") public void doBefore(JoinPoint joinPoint, SystemControllerLog sysLog) { HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()) .getRequest(); String ip = request.getRemoteAddr(); logger.info("ip:" + ip); }
原因是@Before里的注解和方法中的参数名不一致,改为一致后启动正常:
/** * 前置通知,用于拦截controller层的操作 * * @param joinPoint * @param log */ @Before("controllerAspect() && @annotation(sysLog)") public void doBefore(JoinPoint joinPoint, SystemControllerLog sysLog) { HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()) .getRequest(); String ip = request.getRemoteAddr(); logger.info("ip:" + ip); }
相关推荐
The backport is NOT an implementation of JSR-310, as that would require jumping through lots of unnecessary hoops. Instead, this is a simple backport intended to allow users to quickly use the JSR-310...
This document is an annex to Volume 1 release 1.2.1 of the InfiniBand Architecture, herein referred to as the base specification. This annex is Optional Normative, meaning that implementation of the ...
webMethods Developer is a graphical development tool that you use to build edit and test integration logic It provides an integrated development environment in which you can develop the logic and ...
The goal of Entity Linking is to determine whether or not the entity referred to in each query has a matching entity node in the reference Knowledge Base (KB) (LDC2014T16). If there is a matching node...
- The book which you referred to is not in the library. 你提到的那本书不在图书馆。 - His report refers to the situation in the Middle East. 他的报告提到了中东的局势。 2. 当“refer”作为及物动词使用...
简单恢复IMPORTANT-READ CAREFULLY: This End-User License Agreement ("EULA") is a legal agreement between you (either an individual or a single entity) later referred to as "LICENSEE" and MT Solution ...
这是我们需要添加的含有delay_init函数的源文件
users and systems need to have assurance that the key is authentic, that it belongs to the entity with whom or which it is asserted to be associated, and that it has not been accessed by an ...
Error[e16]: Segment CSTACK (size: 0x50 align: 0x1) is too long for segment definition. At least 0x50 more bytes needed. 这是因为定义的全局变量和数组缓冲区超出了硬件支持的RAM限制,解决方法是减少不必要...
I’ve always felt that ...It is not often that one gets to write about such an exciting new programming methodology and language. I enjoyed writing this book. I hope you will enjoy reading it.
Dojo is often referred to as an AJAX framework because of its robust support for AJAX functionalities. AJAX (Asynchronous JavaScript and XML) is a technique used for creating faster and more ...
A reference to an invalid page (a page that is not in your working set) is referred to as a page fault. Assuming the page reference does not result in an access violation, a page fault can be either ...
This document is not intended to be a substitute for detailed product documentation, nor is it a step-by-step guide for installing a vCloud. You should have access to the following documentation ...
It is geared to an audience of both corporate as well as home users. It is not intended to be a full overview of Unix operations, as there are several good texts available as well as on?line ...
The connection type is referred to as Modem and TCPIP respectively. Although NetTerm contains many options, a new user can get up and running very quickly once the connection type is determined. For ...
one another This is commonly referred to as the big ball of mud architecture anti pattern ">It’s all too common for developers to start coding an application without a formal architecture in place ...
operand to be an operation region of any type. It is now restricted to regions of type SystemMemory, as per the ACPI specification. BZ 481 Additional cleanup and optimizations for the new Table ...
Only a small amount of input-referred noise is needed to increase the resolution by the averaging technique; however, use of increased noise requires a larger number of samples in the average, so ...
This type of technology, often referred to as physical computing, is used in all kinds of things from the iPhone to automobile electronics systems. Arduino makes it possible for anyone with an ...