[jboss-svn-commits] JBL Code SVN: r30685 - labs/jbossesb/branches/JBESB_4_7_CP/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Dec 15 13:49:57 EST 2009
Author: tcunning
Date: 2009-12-15 13:49:55 -0500 (Tue, 15 Dec 2009)
New Revision: 30685
Modified:
labs/jbossesb/branches/JBESB_4_7_CP/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ESBDiscoveryComponent.java
Log:
JBESB-3054
Fix the NPE by wrapping the description check in a try/catch.
Modified: labs/jbossesb/branches/JBESB_4_7_CP/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ESBDiscoveryComponent.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_7_CP/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ESBDiscoveryComponent.java 2009-12-15 18:35:50 UTC (rev 30684)
+++ labs/jbossesb/branches/JBESB_4_7_CP/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ESBDiscoveryComponent.java 2009-12-15 18:49:55 UTC (rev 30685)
@@ -34,7 +34,6 @@
resourceKey = drd.getResourceKey();
}
- EmsBean discoverBean = context.getParentResourceComponent().getEmsConnection().getBean(resourceKey);
try {
EmsAttribute versionAttribute = bean.getAttribute(SOADiscoveryComponent.VERSION_NUMBER);
versionNumber = (String) versionAttribute.refresh();
@@ -42,14 +41,19 @@
versionNumber = "";
}
- String name = discoverBean.getBeanName().getKeyProperty(NAME);
- Set<EmsAttribute> attributeSet = discoverBean.getAttributes();
- for (Iterator i = attributeSet.iterator(); i.hasNext();) {
- EmsAttribute attr = (EmsAttribute) i.next();
+ try {
+ EmsBean discoverBean = context.getParentResourceComponent().getEmsConnection().getBean(resourceKey);
+ String name = discoverBean.getBeanName().getKeyProperty(NAME);
+ Set<EmsAttribute> attributeSet = discoverBean.getAttributes();
+ for (Iterator i = attributeSet.iterator(); i.hasNext();) {
+ EmsAttribute attr = (EmsAttribute) i.next();
- if (attr.getName().endsWith(SERVICE_DESCRIPTION)) {
- description = (String) attr.getValue();
+ if (attr.getName().endsWith(SERVICE_DESCRIPTION)) {
+ description = (String) attr.getValue();
+ }
}
+ } catch (Exception e) {
+ description = "Service Entity";
}
for (DiscoveredResourceDetails jmxResource : jmxResources) {
More information about the jboss-svn-commits
mailing list