// Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
if (this.provider instanceof JBossConnectionProvider) {
JBossConnectionProvider jbossProvider = (JBossConnectionProvider) this.provider;
// See https://jira.jboss.org/jira/browse/JOPR-9 for an explanation of why we have to re-set the
// PrincipalInfo prior to every JBoss JMX call.
jbossProvider.resetPrincipalInfo();
}
return method.invoke(this.remoteServer, args);
} catch(InvocationTargetException e) {
failures++;
if (e.getCause() != null) {