[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[aspectj-users] AspectJ in WAR files
|
Hi I am try to do one thing for a log time but without any success.
I am trying to write some aspects, create a war file and deploy them on Jboss.
Everyting works apart from the aspects.
I have 1 java fils: com.person.Person
1 aspect file: com.person.PersonAspect
Person class includes following methods:
public Vector addSomething(String name, String[] books)
throws ModelException, ApplicationException
{...}
I want to catch the above method, so I wrote following in PersonAspect:
"
import org.apache.log4j.Logger;
public aspect PersonAspect {
static Logger logger;
pointcut doPrint(): execution(* PersonAspect.*(..) throws Exception);
before (): doPrint()
{
String classname = thisJoinPoint.getSignature().getDeclaringType
().getName()+".class";
logger = Logger.getLogger(classname);
logger.error("LOGGER == aspect b4 " + thisJoinPoint );
System.out.println("aspect b4 a ");
}
}
However, when I call addSomething(..) no statement is printed onto the console.
I am wondering if there is something wrong woth my code or is it that JBoss
would not print the logging statements.
regards