modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java | 11 +++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
New commits: commit 953cd5b1f47fbada4ed64824daf4b046365ded9e Author: Ian Springer ian.springer@redhat.com Date: Wed May 30 19:00:40 2012 -0400
improve logging to help debug NPE occurring in unit test when running in Jenkins
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java index a7a6408..49e51f4 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossBean.java @@ -52,6 +52,7 @@ import org.quartz.SchedulerException; import org.quartz.SimpleTrigger;
import org.rhq.core.clientapi.agent.PluginContainerException; +import org.rhq.core.clientapi.agent.discovery.DiscoveryAgentService; import org.rhq.core.clientapi.agent.discovery.InvalidPluginConfigurationClientException; import org.rhq.core.clientapi.agent.upgrade.ResourceUpgradeRequest; import org.rhq.core.clientapi.agent.upgrade.ResourceUpgradeResponse; @@ -452,12 +453,12 @@ public class DiscoveryBossBean implements DiscoveryBossLocal, DiscoveryBossRemot MergeResourceResponse mergeResourceResponse; try { AgentClient agentClient = this.agentManager.getAgentClient(parentResource.getAgent()); - mergeResourceResponse = agentClient.getDiscoveryAgentService().manuallyAddResource(resourceType, - parentResourceId, pluginConfiguration, user.getId()); + DiscoveryAgentService discoveryAgentService = agentClient.getDiscoveryAgentService(); + mergeResourceResponse = discoveryAgentService.manuallyAddResource(resourceType, + parentResourceId, pluginConfiguration, user.getId()); } catch (RuntimeException e) { - throw new RuntimeException("Error adding " + resourceType.getName() - + " resource to inventory as a child of the resource with id " + parentResourceId + " - cause: " - + e.getLocalizedMessage(), e); + throw new RuntimeException("Error adding [" + resourceType + + "] Resource to inventory as a child of " + parentResource + " - cause: " + e, e); }
return mergeResourceResponse;
rhq-commits@lists.fedorahosted.org