jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cael Jacobs (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (JCLOUDS-644) Error parsing JSON returned from SoftLayer API causes exception
Date Fri, 01 Aug 2014 12:48:38 GMT

    [ https://issues.apache.org/jira/browse/JCLOUDS-644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14082203#comment-14082203
] 

Cael Jacobs commented on JCLOUDS-644:
-------------------------------------

Hi, Andrea, 

Thanks for the fast response.  I will try again with 1.8.0-SNAPSHOT; I will update when I
have more info.

> Error parsing JSON returned from SoftLayer API causes exception
> ---------------------------------------------------------------
>
>                 Key: JCLOUDS-644
>                 URL: https://issues.apache.org/jira/browse/JCLOUDS-644
>             Project: jclouds
>          Issue Type: Bug
>          Components: jclouds-compute
>    Affects Versions: 1.7.3
>         Environment: Windows 7 and Linux (Ubuntu 12.04 and 14.04), JRE 7.  Running against
the Softlayer v3 API.
>            Reporter: Cael Jacobs
>            Assignee: Andrea Turli
>
> When provisioning a server in Softlayer, using computeService.createNodesInGroup(), I
receive 
> java.util.concurrent.ExecutionException: java.lang.IndexOutOfBoundsException: position
(0) must be less than the number of elements that remained (0)
> The root cause appears to be in at SoftLayerComputeServiceAdapter.java, line 128:
> VirtualGuest result = get(productOrderReceipt.getOrderDetails().getVirtualGuests(), 0);
> The Set returned by .getVirtualGuests() is empty, so attempting to get() item 0 fails
and throws the exception.
> An examination of the JSON returned by the Softlayer API shows that the VirtualGuests
JSON element is populated (heavily trimmed JSON to show just the relevant structure):
> {
> 	"orderDate": "2014-07-31T10:08:09-05:00",
> 	"orderDetails": {
> 		"virtualGuests": [
> 			{
> 				"accountId": 355296,
> 				"createDate": "2014-07-31T10:08:09-05:00",
> 				"dedicatedAccountHostOnlyFlag": false,
> 				"domain": "jclouds.org",
> 				"fullyQualifiedDomainName": "fn-svr-1406819297254.jclouds.org",
> 				"hostname": "fn-svr-1406819297254",
> 				"id": 5654874,
> 				"lastPowerStateId": null,
> 				"lastVerifiedDate": null,
> 				"maxCpu": 1,
> 				"maxCpuUnits": "CORE",
> 				"maxMemory": 1024,
> 				"metricPollDate": null,
> 				"modifyDate": null,
> 				"startCpus": 1,
> 				"statusId": 1001
> 			}
> 		]
> 	}
> }
> It appears to me that there is something going wrong in the parsing of the JSON returned
by the SoftLayer API



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message