메뉴 건너띄기
상단메뉴 바로가기
본문 바로가기

이 누리집은 대한민국 공식 전자정부 누리집입니다.

본문 영역

적용 지원, FAQ, Q&A 게시판을 통해 기술 문제 해결을 지원합니다.

묻고 답하기

AOP 적용 안됨 (재질문)
  • 작성자

    박*우

  • 작성일

    2013-04-18 11:38:39

  • 조회수

    2,407

  • 구분

    개발환경

  • 진행상태

    완료

질문

expression="execution(* *(..))"

이렇게 모든 메소드를 지정하면 AOP 를 탑니다.


expression="execution(* iwe.cmmn.web.service.impl..*(..))"

이렇게 패키지를 지정하면,
서비스 메소드 (getMemberId(MemberVO memverVO)는 정상 작동 하고 있는데
AOP 를 안탑니다. (이게 가장 궁금)


그리고

expression="execution(* * iwe.cmmn.web.service.impl..*(..))"

이렇게 하면

Could not instantiate bean class [org.springframework.aop.aspectj.AspectJPointcutAdvisor]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: Pointcut is not well-formed: expecting '(' at character position 14
execution(* * iwe.cmmn.web.service.impl..*(..))
^^^
이런 에러가 나는데 execution 문법이 잘못된건가요?




서비스의 패키지 구성은 다음과 같습니다.
iwe.cmmn.web.service
iwe.cmmn.web.service.impl



먼저 AOP 를 못 타는 이유가 궁금하구요.



AOP 를 탔을때 에러는 다음과 같습니다.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loginController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'beanValidator' must be of type [org.springmodules.validation.commons.DefaultBeanValidator], but was actually of type [$Proxy20]

답변

안녕하세요. 박성우님
아래 URL을 참고하시기 바랍니다.(6.2.3.4. 예제 부분)
http://openframework.or.kr/framework_reference/spring/ver2.x/html/aop.html
고맙습니다.

이 페이지의 구성

묻고 답하기