Skip to content

Commit

Permalink
MBeanExporter logs lazy bean retrieval exceptions on the server at wa…
Browse files Browse the repository at this point in the history
…rn level

Issue: SPR-12399
  • Loading branch information
jhoeller committed Oct 30, 2014
1 parent db2601d commit 5f160c1
Showing 1 changed file with 13 additions and 0 deletions.
Expand Up @@ -1097,6 +1097,19 @@ public void setObjectName(ObjectName objectName) {
this.objectName = objectName;
}

@Override
public Object getTarget() {
try {
return super.getTarget();
}
catch (RuntimeException ex) {
if (logger.isWarnEnabled()) {
logger.warn("Failed to retrieve target for JMX-exposed bean [" + this.objectName + "]: " + ex);
}
throw ex;
}
}

@Override
protected void postProcessTargetObject(Object targetObject) {
injectNotificationPublisherIfNecessary(targetObject, this.modelMBean, this.objectName);
Expand Down

0 comments on commit 5f160c1

Please sign in to comment.