From: <sc...@hy...> - 2009-06-17 17:45:38
|
Author: scottmf Date: 2009-06-17 10:45:26 -0700 (Wed, 17 Jun 2009) New Revision: 13363 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13363 Modified: trunk/src/org/hyperic/hq/bizapp/server/session/AppdefBossEJBImpl.java trunk/src/org/hyperic/hq/bizapp/server/session/MetricSessionEJB.java trunk/src/org/hyperic/hq/ui/action/resource/hub/RemoveResourceAction.java Log: [HHQ-3193] this fixes null pointer exceptions associated with async delete. Also fixes a StaleStateException that occurs when a resource is deleted while in a CRISPO. The background thread attempts to delete the Crispo as well as the foreground thread. Removed the update of the associated Crispos from the foreground. Modified: trunk/src/org/hyperic/hq/bizapp/server/session/AppdefBossEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/server/session/AppdefBossEJBImpl.java 2009-06-17 08:11:50 UTC (rev 13362) +++ trunk/src/org/hyperic/hq/bizapp/server/session/AppdefBossEJBImpl.java 2009-06-17 17:45:26 UTC (rev 13363) @@ -1333,6 +1333,11 @@ throw new ApplicationException(se); } } + if (res == null) { + log.warn("AppdefEntityId=" + aeid + + " is not associated with a Resource"); + return new AppdefEntityID[0]; + } AppdefEntityID[] removed = resMan.removeResourcePerms( subject, res, false); try { Modified: trunk/src/org/hyperic/hq/bizapp/server/session/MetricSessionEJB.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/server/session/MetricSessionEJB.java 2009-06-17 08:11:50 UTC (rev 13362) +++ trunk/src/org/hyperic/hq/bizapp/server/session/MetricSessionEJB.java 2009-06-17 17:45:26 UTC (rev 13363) @@ -446,6 +446,9 @@ for (int i = 0; i < ids.length; i++) { final Resource r = rMan.findResource(ids[i]); + if (r == null || r.isInAsyncDeleteState()) { + continue; + } if (midMap.containsKey(r.getId())) { Integer mid = ((Measurement)midMap.get(r.getId())).getId(); MetricValue mval = null; Modified: trunk/src/org/hyperic/hq/ui/action/resource/hub/RemoveResourceAction.java =================================================================== --- trunk/src/org/hyperic/hq/ui/action/resource/hub/RemoveResourceAction.java 2009-06-17 08:11:50 UTC (rev 13362) +++ trunk/src/org/hyperic/hq/ui/action/resource/hub/RemoveResourceAction.java 2009-06-17 17:45:26 UTC (rev 13363) @@ -161,8 +161,6 @@ } } - removeResourcesFromDashboard(request, deleted); - if (vetoed > 0) { RequestUtils .setError(request, |