Hi Hank,

it seems that you try to deserialize an entity with the service document 
deserializer. What is happening is that it is looking for the values array 
which should look something like that: 
"value": [
{
"name": "ESAllPrim",
"url": "ESAllPrim"
}]

I don`t know how you call the deserializer but please make sure that your URL 
is pointing to the service document. 

Also the best place for questions like this is the [email protected] 
mailing list since this question might also be of interest for other users. The 
dev mailing list is for development related discussions. If you would like to 
subscribe to our user list please write a mail to: 
[email protected] 

Best Regards,
Christian

-----Original Message-----
From: Hank Bruning [mailto:[email protected]] 
Sent: Mittwoch, 26. August 2015 20:54
To: [email protected]
Subject: JSONServiceDocumentDeserializer question

I am not sure if there is a bug in the source HTML document or in  the class

org.apache.olingo.client.core.data;.JSONServiceDocumentDeserializer
from Olingo Java 4, beta 3, Line 72  which is
for (final Iterator<JsonNode> itor = tree.get(Constants.VALUE).elements();

The code is throwing a NullPointerException because
tree.get(Constants.VALUE)== null.

The JSON message is
{
    "@Redfish.Copyright": "Copyright © 2014-2015 Distributed Management
Task Force, Inc. (DMTF). All rights reserved.",
    "@odata.context": "/redfish/v1/$metadata#Chassis",
    "@odata.id": "/redfish/v1/Chassis",
    "@odata.type": "#ChassisCollection.ChassisCollection",
    "Name": "Chassis Collection",
    "[email protected]": 5,
    "Members": [
        {
            "@odata.id": "/redfish/v1/Chassis/1"
        },
        {
            "@odata.id": "/redfish/v1/Chassis/Enc1"
        },
        {
            "@odata.id": "/redfish/v1/Chassis/Blade1"
        },
        {
            "@odata.id": "/redfish/v1/Chassis/Blade2"
        }
    ],
    "[email protected]": "/redfish/v1/Chassis/Page2/$ref"
}

and the tree object contains 7 elements which are

//   "@Redfish.Copyright":"Copyright © 2014-2015 Distributed Management
Task Force, Inc. (DMTF). All rights reserved.",
//   "@odata.id":"/redfish/v1/Chassis",
//   "@odata.type":"#ChassisCollection.ChassisCollection",
//    "Name":"Chassis Collection",
//    "[email protected]":5,
//     "Members":[{"@odata.id":"/redfish/v1/Chassis/1"},
//                                               {"@odata.id
":"/redfish/v1/Chassis/Enc1"},
//                                               {"@odata.id
":"/redfish/v1/Chassis/Blade1"},
//                                               {"@odata.id
":"/redfish/v1/Chassis/Blade2"}],
//    "[email protected]":"/redfish/v1/Chassis/Page2/$ref"}

Any idea what the problem is ? Where should I look next ?
Hank

Reply via email to