Open GoogleCodeExporter opened 8 years ago
This same type of problem exists when I try to terminate an instance using the
Jec2.terminateInstances(String[] instanceIds) method within the same
environment described above. Again, the problem can be traced back to a
specific line of code that makes assumptions about the existence of a specific
object. In this case, it is line 781 of the Jec2 class within the
List<InstanceStateChangeDescription> terminateInstances(List<String>
instanceIds) method that says:
Iterator instances_iter = set.getItems().iterator();
In my described environment, the call:
InstanceStateChangeSetType set = response.getInstancesSet();
directly above line 781 returns null for the set object. To fix this, I simply
put another null test around the code that uses the set object:
if(set != null) {
Iterator instances_iter = set.getItems().iterator();
while (instances_iter.hasNext()) {
InstanceStateChangeType rsp_item =
(InstanceStateChangeType)instances_iter.next();
res.add(new InstanceStateChangeDescription(
rsp_item.getInstanceId(), rsp_item.getPreviousState().getName(),
rsp_item.getPreviousState().getCode(),
rsp_item.getCurrentState().getName(),
rsp_item.getCurrentState().getCode()));
}
}
And everything worked without producing the NullPointerException.
Original comment by etblackw...@gmail.com
on 21 Feb 2012 at 8:36
Thanks to the OP. You saved my life ;)
I recompiled and it works.
I attached the fixed ReservationDescription (changed from the 1.7.2 version).
If someone could take this fix, and others, and make a new release it would be
great.
P.S.: I also included an unofficial build with this fix. I called it 1.7.3.
Original comment by petersai...@gmail.com
on 18 Nov 2012 at 12:05
Attachments:
Original issue reported on code.google.com by
etblackw...@gmail.com
on 21 Feb 2012 at 7:03