Announcement Announcement Module
Collapse
No announcement yet.
pertarget pointcut error Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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 org.aspectj.weaver.tools.PointcutParser.parsePoint cutExpression(PointcutParser.java:315)
    at org.springframework.aop.aspectj.AspectJExpressionP ointcut.buildPointcutExpression(AspectJExpressionP ointcut.java:197)
    at org.springframework.aop.aspectj.AspectJExpressionP ointcut.checkReadyToMatch(AspectJExpressionPointcu t.java:184)
    at org.springframework.aop.aspectj.AspectJExpressionP ointcut.getMethodMatcher(AspectJExpressionPointcut .java:170)
    at org.springframework.aop.support.ComposablePointcut .union(ComposablePointcut.java:155)
    at org.springframework.aop.support.Pointcuts.union(Po intcuts.java:52)
    at org.springframework.aop.aspectj.annotation.Instant iationModelAwarePointcutAdvisorImpl.<init>(Instant iationModelAwarePointcutAdvisorImpl.java:83)
    at org.springframework.aop.aspectj.annotation.Reflect iveAspectJAdvisorFactory.getAdvisor(ReflectiveAspe ctJAdvisorFactory.java:134)
    at org.springframework.aop.aspectj.annotation.Reflect iveAspectJAdvisorFactory$1.doWith(ReflectiveAspect JAdvisorFactory.java:74)
    at org.springframework.util.ReflectionUtils.doWithMet hods(ReflectionUtils.java:402)
    at org.springframework.util.ReflectionUtils.doWithMet hods(ReflectionUtils.java:379)
    at org.springframework.aop.aspectj.annotation.Reflect iveAspectJAdvisorFactory.getAdvisors(ReflectiveAsp ectJAdvisorFactory.java:70)
    at org.springframework.aop.aspectj.annotation.BeanFac toryAspectJAdvisorsBuilder.buildAspectJAdvisors(Be anFactoryAspectJAdvisorsBuilder.java:128)
    at org.springframework.aop.aspectj.annotation.Annotat ionAwareAspectJAutoProxyCreator.findCandidateAdvis ors(AnnotationAwareAspectJAutoProxyCreator.java:85 )
    at org.springframework.aop.aspectj.autoproxy.AspectJA wareAdvisorAutoProxyCreator.shouldSkip(AspectJAwar eAdvisorAutoProxyCreator.java:105)
    at org.springframework.aop.framework.autoproxy.Abstra ctAutoProxyCreator.postProcessBeforeInstantiation( AbstractAutoProxyCreator.java:244)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyBeanPostProcessors BeforeInstantiation(AbstractAutowireCapableBeanFac tory.java:724)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.resolveBeforeInstantiat ion(AbstractAutowireCapableBeanFactory.java:695)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory$1.run(AbstractAutowireC apableBeanFactory.java:373)

  • #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.

    Comment


    • #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.

      Comment


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

        Code:
        @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:

        Code:
        @Before("insertPointcut(vo)")
        public void someAdvice(BaseRecordAttributeVO vo) throws Throwable {
          ...
        }

        Comment


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

          My Advice is
          Code:
          @Around("insertPointcut(vo)")
          public void someAdvice(BaseRecordAttributeVO vo) throws Throwable {
          ...
          }

          Comment

          Working...
          X