Inconsistencies between two environments
earnest.dyke May 11, 2011 9:22 AMGreetings all,
I have create a simple aspect (see below) which is deployed as a .jar file and the associated *-aop.xml file (also below). If I deploy these on my local EAP 5.0 32-bit server with JDK 1.6.0 I get all of the logged methods executions I expect. If I deploy the same .jar and *-aop.xml to my EAP 5.0 64-bit server I only get some of the method executions logged. I have set verbose=true in conf/bootstrap/aop.xml but see nothing that would indicate why this is happening.
Any one have any ideas? I am stuck at this point.
Thanks in advance for any and all pertinent responses.
Earnie!
TimingAspect.java
package com.ferguson.performance; import java.lang.reflect.Method; import org.jboss.aop.joinpoint.MethodInvocation; import org.jboss.logging.Logger; public class TimingAspect { private static Logger log = Logger.getLogger(TimingAspect.class); private static Long cnt = 01l; public Object timeExection(MethodInvocation invocation) throws Throwable { long id = 0l; String method = null; if (invocation.getTargetObject() == null) { // static method call Method m = invocation.getActualMethod(); String[] classParts = m.getDeclaringClass().getName().split("\\."); String[] methodParts = m.getName().split("\\$"); method = m.getDeclaringClass().getName() + "." + methodParts[classParts.length]; } else { method = invocation.getTargetObject().getClass().getName() + "." + invocation.getMethod().getName(); } synchronized (cnt) { cnt++; id = cnt; } long startTime = System.currentTimeMillis(); log.info("Start: " + id + " " + method); try { return invocation.invokeNext(); } catch (Exception e) { log.error("Timing error",e); return null; } finally { long endTime = System.currentTimeMillis(); log.info("End: " + id + " " + (endTime - startTime)); } } }
*-aop.xml deployed separately.
<?xml version="1.0" encoding="UTF-8"?> <aop xmlns="urn:jboss:aop-beans:1.0"> <aspect class="com.ferguson.performance.TimingAspect" /> <bind pointcut="execution(* com.ferguson.gateway.business.*->*(..)) OR execution(* com.ferguson.gateway.dao.*->*(..))"> <around aspect="com.ferguson.performance.TimingAspect" name="timeExection" /> </bind> </aop>