AOP 에서 pointcut 형식 오류.
<aop:config>
<aop:aspect id="traceAspect" ref="logPrintProfiler4">
<aop:pointcut expression="execution(* org.doit.ik.aop..*.*(*,*))" id="publicMethod"/>
<aop:around method="trace" pointcut="publicMethod"/>
<aop:before method="before" pointcut="publicMethod"/>
<aop:after method="afterFinally" pointcut="publicMethod"/>
</aop:aspect>
</aop:config>
-> 내가 적은 코드 (에러 발생 코드)
여기에서 " pointcut " 이 아니라 " pointcut-ref " 를 넣어줘야한다.
<aop:config>
<aop:aspect id="traceAspect" ref="logPrintProfiler4">
<aop:pointcut expression="execution(* org.doit.ik.aop..*.*(*,*))" id="publicMethod"/>
<aop:around method="trace" pointcut-ref="publicMethod"/>
<aop:before method="before" pointcut-ref="publicMethod"/>
<aop:after method="afterFinally" pointcut-ref="publicMethod"/>
</aop:aspect>
</aop:config>
이렇게 바꿔줬더니 에러가 해결됐다.
반응형
'Java > Spring' 카테고리의 다른 글
HTTP 요청 데이터 처리 방법 3가지 (0) | 2023.10.12 |
---|---|
좋은 객체 지향 설계의 5가지 원칙 (SOLID) (0) | 2023.07.27 |
[Spring Security] 스프링 시큐리티 초기 세팅 및 로그인 권한 설정 (0) | 2023.07.05 |
[Spring] Annotation 정리 (0) | 2022.11.28 |