Json Array使用RoboSpice的问题

时间:2014-11-21 00:43:42

标签: json robospice spring-android

我正在尝试解析以下JSON数组:

[{"desc": "A coffee-based beverage or dessert. Usually refers to the act of topping a drink or dessert with esp...", "image_url": "http://upload.wikimedia.org/wikipedia/commons/thumb/1/19/Affogato.JPG/800px-Affogato.JPG", "id": "affogato", "name": "Affogato"}, {"desc": "A style of coffee prepared by adding hot water to espresso, giving a similar strength to but differe...", "image_url": "", "id": "americano", "name": "Caffe Americano"}]

我的java代码:

@JsonIgnoreProperties(ignoreUnknown = true)
public class CoffeeList extends ArrayList<Coffee> {

    public CoffeeList() {
    }
}

@Override
public CoffeeList loadDataFromNetwork() throws Exception {
    return getRestTemplate().getForObject(baseUrl, CoffeeList.class);
}

结果:

java.lang.NullPointerException

“在调用Web服务期间发生异常。”

我做什么?

0 个答案:

没有答案