Results 1 to 5 of 5

Thread: pertarget pointcut error

  1. #1
    Join Date
    Aug 2007
    Posts
    3

    Default 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. #2
    Join Date
    Sep 2007
    Location
    Oceanside, CA
    Posts
    187

    Default

    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.
    Mike Bingham

  3. #3
    Join Date
    Aug 2007
    Posts
    3

    Default

    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. #4
    Join Date
    Sep 2007
    Location
    Oceanside, CA
    Posts
    187

    Default

    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 {
      ...
    }
    Mike Bingham

  5. #5
    Join Date
    Aug 2007
    Posts
    3

    Default

    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 {
    ...
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •