嗨我正在尝试在zk框架上解析json响应到java中
这是杰森的答复
{"currentTime":1355390722038,"text":"OK","data":{"limitExceeded":false,"references":{"stops":[],"situations":[],"trips":[],"routes":[],"agencies":[{"id":"AG1","privateService":false,"phone":"","timezone":"Asia/Kuala_Lumpur","disclaimer":"","name":"Panorama","lang":"en","url":"http://www.allcompanyonline.com/company/33/8/26/62438/PM-Cultural--Tourism-Sdn-Bhd.html"}]},"list":[{"lonSpan":0.1766824722290039,"lon":102.2011971473685,"agencyId":"AG1","lat":2.2659808772471948,"latSpan":0.15555363245723042}]},"code":200,"version":2}
Run Code Online (Sandbox Code Playgroud)
我一直收到这个错误
com.fasterxml.jackson.databind.JsonMappingException: Can not instantiate value of type [simple type, class com.panorama.tripplan.pojo.Agency_coverage] from Long integral number; no single-long-arg constructor/factory method
Run Code Online (Sandbox Code Playgroud)
这是根变量的pojo
@JsonRootName(value = "currentTime")
public class Agency_coverage{
private Number code;
private Number currentTime;
private Data data;
private String text;
private Number version;
public Agency_coverage(){}
public Number getCode(){
return this.code;
}
public void setCode(Number code){
this.code = code;
}
public Number getCurrentTime(){
return this.currentTime;
}
public void setCurrentTime(Number currentTime){
this.currentTime = currentTime;
}
public Data getData(){
return this.data; …Run Code Online (Sandbox Code Playgroud)