Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] AspectJ in WAR files

i'm not an AspecJ expert, but i would try this:

pointcut doPrint(): execution(* PersonAspect.*(..) throws ModelException,
ApplicationException );

if you find the solution, please, tell me
-----Mensaje original-----
De: qqasim@xxxxxxxxxxxxxx [mailto:qqasim@xxxxxxxxxxxxxx]
Enviado el: viernes, 22 de agosto de 2003 13:17
Para: aspectj-users@xxxxxxxxxxx
Asunto: [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

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


Back to the top