我使用以下代码在亚马逊ec2中创建EBS卷。相同的代码正在生产中并且工作正常。但是从最近几天开始,我得到了一个新例外。我找不到某个错误。请帮助理解错误。
else if (cloudType.toUpperCase().equalsIgnoreCase("AWS-EC2")) {
EC2Api ec2Api = computeServiceContext.unwrapApi(EC2Api.class);
LOG.info("initialized ec2 api for volume creation");
org.jclouds.ec2.domain.Volume volume = ec2Api
.getElasticBlockStoreApi()
.get()
.createVolumeInAvailabilityZone(zoneId, size);
ec2Api.getTagApi().get().applyToResources(ImmutableMap.of("Name",volumeName), ImmutableSet.of(volume.getId()));
responseTemplate.setJobId(volume.getId());
responseTemplate.setCreationTime(volume.getCreateTime());
responseTemplate.setZoneId(volume.getAvailabilityZone());
}
例外:
java.lang.IllegalArgumentException: argument at index 0 on invocation.getInvoked() public abstract org.jclouds.ec2.domain.Volume org.jclouds.ec2.features.ElasticBlockStoreApi.createVolumeInAvailabilityZone(java.lang.String,int) was null