}
catch(NoSuchMethodException nsme) {
// Should not happen, since it is an abstract method and
// there has to be an implementation for it.
log.error("Internal error: Could not find HotSpotAdvice.advice() method", nsme);
throw new InstrumentationException("Could not find method advice() from " + advice.getClass() + ": " + nsme);
}
catch(ClassNotFoundException cnfe) {
// Should not happen, can happen if Advice was loaded
// from a place other than classpath
log.error("Internal error: Could load class HotSpotAdvice", cnfe);
throw new InstrumentationException("Could not load class " + advice.getClass() + ": " + cnfe);
}
catch(java.io.IOException ioe) {
// Should not happen
log.error("Internal error: Could load class HotSpotAdvice", ioe);
throw new InstrumentationException("Could not load class " + advice.getClass() + ": " + ioe);
}
catch(Exception e) {
log.error("Failed to initialize HotSpotAdvisor", e);
throw new InstrumentationException("Failed to initialize HotSpotAdvisor: " + e);
}
}