You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by David Grizzanti <da...@sungard.com> on 2013/11/25 17:24:58 UTC

NullPointerException when invalid zone is passed into UsageEventUtils (CLOUDSTACK-5220)

Hi All,

I submitted a bug for null pointer exceptions I'm seeing when certain types of Usage Events are generated (when you have the event notification bus enabled).  Initially I had submitted two separate bugs for individual events causing null pointer exceptions (CLOUDSTACK-5023 and CLOUDSTACK-5062).

The issue here is that the publishUsageEvents function assumes that a valid zoneId is passed in for it to use when generating the Event.  However, it many cases the caller is passing in "0", which causes a null pointer exception in publishUsageEvents.  I realized after looking a bit more that in some cases, the zone may not be relevant to the event being generated (i.e. adding VPN users to a project).  So, I proposed a fix in CLOUDSTACK-5220 which will catch cases where a 0 is passed for the zoneId and leave off the zone when the usage events is generated.

Does this sound like an acceptable solution to everyone?

Thanks
-- 
David Grizzanti
Software Engineer
Sungard Availability Services

e: david.grizzanti@sungard.com
w: 215.446.1431
c: 570.575.0315