Index: src/main/org/jboss/aop/joinpoint/MethodInvocation.java =================================================================== --- src/main/org/jboss/aop/joinpoint/MethodInvocation.java (revision 82216) +++ src/main/org/jboss/aop/joinpoint/MethodInvocation.java (working copy) @@ -145,10 +145,10 @@ if (target == null) throw new IllegalArgumentException("Null target for method " + method); - Class methodClass = method.getClass(); + Class methodClass = method.getDeclaringClass(); Class targetClass = target.getClass(); if (methodClass.isAssignableFrom(targetClass) == false) - throw new IllegalArgumentException("Wrong target. " + targetClass + " for " + method); + throw new IllegalArgumentException("Wrong target. " + targetClass + " for " + method, t); ArrayList expected = new ArrayList(); Class[] parameterTypes = method.getParameterTypes(); for (int i = 0; i < parameterTypes.length; ++i) Index: src/main/org/jboss/aop/ClassAdvisor.java =================================================================== --- src/main/org/jboss/aop/ClassAdvisor.java (revision 82216) +++ src/main/org/jboss/aop/ClassAdvisor.java (working copy) @@ -403,7 +403,7 @@ // String wrappedName = ClassAdvisor.notAdvisedMethodName(clazz.getName(), methods[k].getName()); // Method method = clazz.getMethod(wrappedName, methods[k].getParameterTypes()); Method method = getMethod(clazz, methods[k]); - long hash = MethodHashing.methodHash(method); + long hash = this.methodHash(method); unadvisedMethods.put(hash, method); } } @@ -1466,7 +1466,7 @@ { if (ClassAdvisor.isAdvisable(declaredMethods[i])) { - long hash = MethodHashing.methodHash(declaredMethods[i]); + long hash = this.methodHash(declaredMethods[i]); advisedMethods.put(hash, declaredMethods[i]); try { @@ -2880,4 +2880,21 @@ conCalledByMethodInterceptors.clear(); } } + + /** + * Obtains a hash for the specified method + * + * @param method + * @return + * @throws Exception + */ + protected long methodHash(Method method) throws Exception + { + long hash = MethodHashing.methodHash(method); + if (logger.isTraceEnabled()) + { + logger.trace("Method Hash: " + hash + " / " + method); + } + return hash; + } }