Announcement Announcement Module
No announcement yet.
pertarget pointcut error Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • pertarget pointcut error

    I am getting exception when i try to use this point cut at Aspect level using pertarget
    Here is stacktrace.

    @Aspect("pertarget(execution(* business.persistence.iface.BaseRecordAttrDAO.*(..) ))")

    Caused by: java.lang.IllegalArgumentException: warning no match for this type name: vo [Xlint:invalidAbsoluteTypeName]
    at cutExpression(
    at org.springframework.aop.aspectj.AspectJExpressionP ointcut.buildPointcutExpression(AspectJExpressionP
    at org.springframework.aop.aspectj.AspectJExpressionP ointcut.checkReadyToMatch(AspectJExpressionPointcu
    at org.springframework.aop.aspectj.AspectJExpressionP ointcut.getMethodMatcher(AspectJExpressionPointcut .java:170)
    at .union(
    at org.springframework.aop.aspectj.annotation.Instant iationModelAwarePointcutAdvisorImpl.<init>(Instant
    at org.springframework.aop.aspectj.annotation.Reflect iveAspectJAdvisorFactory.getAdvisor(ReflectiveAspe
    at org.springframework.aop.aspectj.annotation.Reflect iveAspectJAdvisorFactory$1.doWith(ReflectiveAspect
    at org.springframework.util.ReflectionUtils.doWithMet hods(
    at org.springframework.util.ReflectionUtils.doWithMet hods(
    at org.springframework.aop.aspectj.annotation.Reflect iveAspectJAdvisorFactory.getAdvisors(ReflectiveAsp
    at org.springframework.aop.aspectj.annotation.BeanFac toryAspectJAdvisorsBuilder.buildAspectJAdvisors(Be
    at org.springframework.aop.aspectj.annotation.Annotat ionAwareAspectJAutoProxyCreator.findCandidateAdvis ors( )
    at org.springframework.aop.aspectj.autoproxy.AspectJA wareAdvisorAutoProxyCreator.shouldSkip(AspectJAwar
    at org.springframework.aop.framework.autoproxy.Abstra ctAutoProxyCreator.postProcessBeforeInstantiation(
    at AutowireCapableBeanFactory.applyBeanPostProcessors BeforeInstantiation(AbstractAutowireCapableBeanFac
    at AutowireCapableBeanFactory.resolveBeforeInstantiat ion(
    at AutowireCapableBeanFactory$

  • #2
    Are you sure that this expression is the source of the error? What other pointcuts do you have defined in this (or other) aspects? The exception seems to indicate that a pointcut expression is defined somewhere with an absolute type name of "vo", which is not found.


    • #3
      I declare one of the Pointcut in that aspect like this.

      "@Pointcut("execution(* business.persistence.iface.BaseRecordAttrDAO.inser t(..)) && args(vo)")
      protected void insertPointcut(BaseRecordAttributeVO vo) {}"

      But what I don't understand is that how pertarget Pointcut related
      other Pointcut declared in the Aspect. Is any thing I missing?

      Thanks you for your response.


      • #4
        How is the following pointcut referenced in an advice method?

        @Pointcut("execution(* business.persistence.iface.BaseRecordAttrDAO.insert(..)) && args(vo)")
        protected void insertPointcut(BaseRecordAttributeVO vo) {}
        Does the parameter name for the named pointcut match the name of the bound parameter in the advice method? For example:

        public void someAdvice(BaseRecordAttributeVO vo) throws Throwable {


        • #5
          parameter name for the named pointcut match the name of the bound parameter in the advice method? Yes

          My Advice is
          public void someAdvice(BaseRecordAttributeVO vo) throws Throwable {