[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] [warning] advice defined in Logger has notbeenapplied [Xlint:adviceDidNotMatch]

I’d guess that addTask isn’t declared on TaskManagementService (e.g., is it an implementation method), or that you are statically calling a different method (e.g., a superclass). Can you summarize the type hierarchy, where addTask is declared, and how it is called?

 


From: aspectj-users-bounces@xxxxxxxxxxx [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Roland Piazzi
Sent: Thursday, September 20, 2007 8:00 AM
To: Roland Piazzi; aspectj-users@xxxxxxxxxxx
Subject: Re: [aspectj-users] [warning] advice defined in Logger has notbeenapplied [Xlint:adviceDidNotMatch]

 

if i change

 

call (* TaskManagementService.addTask(..))

 

to

 

call (* *.addTask(..))

 

it works

 

----- Original Message -----

Sent: Thursday, September 20, 2007 4:28 PM

Subject: [aspectj-users] [warning] advice defined in Logger has not beenapplied [Xlint:adviceDidNotMatch]

 

Hi!

 

I try to compile my classes and aspects with the -showWeaveInfo option and it gives me the following warning:

 

[warning] advice defined in Logger has not been applied [Xlint:adviceDidNotMatch]

 

My Aspect looks like this:

 

public aspect Logger {

 

pointcut loggingAddTask(Task task):

    call (* TaskManagementService.addTask(..)) &&

    args(task) &&

    !within(Logger);

 

after(Task task) returning: loggingAddTask(task) {

        System.out.println("Hello");

        System.out.println("TaskId:"+task.getId());

        JAXBContext jc;

        try {

            jc = JAXBContext.newInstance("jaxbclasses");

            Marshaller mars= jc.createMarshaller();

            ObjectFactory objFactory= new ObjectFactory();

            Log log= objFactory.createLog();

            AddTaskElement addTask = log.getAddTask();

            addTask.setID(task.getId());

            try {

                mars.marshal(log, new FileOutputStream("C:\\studium\\diplomarbeit\\testjaxb\\log.xml"));

            } catch (FileNotFoundException e) {

                    e.printStackTrace();

            }

        } catch (JAXBException e) {

                e.printStackTrace();

        }

}

 

I've already searched in the list, and also found something like this, but did not help.

Can anyone help me please?

Thanks, Roland


_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users