Roland Piazzi
2007-09-20 14:28:12 UTC
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
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