Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Beginner Question adviceDidNotMatch

Hello,

   I am a beginner in using aspectj and AOP in general, and would really appreciate any I help I can receive. In the event of an obvious error please pardon me, I have looked for messages/help related to adviceDidNotMatch. I understand that the pointcut I have defined does not identify any applicable join points in my program. However I am at a loss as to the reason for this

I am trying to write an advice following the construction of an object, the constructor signature is as below

ConnectionPool(SysServiceable services, String dbID)

I have defined pointcuts as follows (I am trying both execution and intialization )

pointcut initConnectionPool(SysServiceable services, String dbID) : execution(com.primavera.infr.db.DBConnectionPool.new(SysServiceable, String)) && args(services, dbID);

pointcut initConnectionPoola(SysServiceable services, String dbID) : initialization( com.primavera.infr.db.DBConnectionPool.new(SysServiceable, String))  && args(services, dbID);

(Should I be using exection/call/initialization in this case?)
and my advice is as following

after(SysServiceable services, String dbID) : initConnectionPool(services, dbID)
{
    System.out.println("Connection pool is inited");
}
   
after(SysServiceable services, String dbID) : initConnectionPoola(services, dbID)
{
    System.out.println("Connection pool is inited");
}

On compilation, I receive the warning message "advice defined in .... has not been applied [Xlint:adviceDidNotMatch]

I am both compiling and weaving my code at the same time and expect the advice to be applied and therefore cannot proceed without resolving this issue. Once again any help is appreciated and Thank you

- Bhaskar

Back to the top