Results 1 to 10 of 13

Thread: Pointcut is not well-formed: expecting 'name pattern' at character position 116

Hybrid View

  1. #1
    Join Date
    Sep 2006
    Posts
    20

    Default Pointcut is not well-formed: expecting 'name pattern' at character position 116

    I am using Jboss 4.2.1, I create an aspect and have the followling exception when deploy in JBoss and compiled from Eclipse:

    Pointcut is not well-formed: expecting 'name pattern' at character position 116execution(public com.XXXX.XXXX.backingbean.publish.PublishDAO.publi shDocument(DocumentItem) && args(documentItem))

    this is my Aspect class:

    package com.XXXX.XXXX.aop;

    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    import org.aspectj.lang.annotation.After;
    import org.aspectj.lang.annotation.Aspect;
    import org.aspectj.lang.annotation.Pointcut;

    import com.XXXX.XXXX.bo.DocumentItem;

    @Aspect
    public class DashBoardAspect {

    Log log=LogFactory.getLog(DashBoardAspect.class);

    public void saveSuccessLogin(){

    }


    @After("execution(public com.XXXX.XXXX.backingbean.publish.PublishDAO.publi shDocument(DocumentItem) && args(documentItem))")
    public void saveDocumentItem(DocumentItem documentItem){

    log.info("-------------documentItemID:"+documentItem.getId());

    }
    }

    This is when I put in the spring configuration file
    <aop:aspectj-autoproxy/>

    <bean id="dashBoardAspect" class="com.XXXX.XXXX.aop.DashBoardAspect"/>

    thanks for your help

  2. #2
    Join Date
    Aug 2004
    Posts
    2,715

    Default

    Perhaps it should be "execution(public * ...".

    Regards,
    Andreas

  3. #3
    Join Date
    Sep 2006
    Posts
    20

    Default

    no it is not working, any more idea.

  4. #4
    Join Date
    Aug 2004
    Posts
    2,715

    Default

    I just see the closing parenthesis of the execution element contains also the args element. This won't work. Besides that see here for configuration examples (argument specification is a bit below).

    This should work then:
    @After("com.XXXX.XXXX.backingbean.publish.PublishD AO.publi shDocument(DocumentItem) && args(documentItem)")

    Regards,
    Andreas

  5. #5
    Join Date
    Sep 2006
    Posts
    20

    Default

    after the change I get the following error:

    Severity and Description Path Resource Location Creation Time Id
    Pointcut is malformed: warning no match for this type name: DocumentItem [Xlint:invalidAbsoluteTypeName] publish.xml line 196 1206027308644 392639

    any idea, thanks

  6. #6
    Join Date
    Jun 2006
    Location
    SF Bay Area, California
    Posts
    524

    Default

    I think the problem is that you should use fully qualified type name for DocumentItem.

    Code:
    @After("com.XXXX.XXXX.backingbean.publish.PublishDAO.publi shDocument(com.XXXX.XXXX.bo.DocumentItem) && args(documentItem)")
    -Ramnivas
    Ramnivas Laddad (Follow me on Twitter)
    AspectJ in Action: Enterprise AOP with Spring Applications (2nd edition). Now available!

Posting Permissions

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