}
// Determine the type that declares the requested method, taking into account proxies
Class<?> target = AopUtils.getTargetClass(object);
if (object instanceof Advised) {
Advised a = (Advised) object;
if (!a.isProxyTargetClass()) {
Class<?>[] possibleInterfaces = a.getProxiedInterfaces();
for (Class<?> possibleInterface : possibleInterfaces) {
try {
possibleInterface.getMethod(methodName, classArgs);
// to get here means no exception happened
target = possibleInterface;