我正在利用Spring提供的这个很酷的东西:Spring RESTWebService(spring的版本是3).如果我从浏览器访问URL,我可以看到JSON响应,但是从客户端端点(Android应用程序)iIreceive这个错误消息:
Caused by: org.springframework.web.client.ResourceAccessException:
I/O error: Can not deserialize instance of MyObject out of START_ARRAY token
at [Source: org.apache.http.conn.EofSensorInputStream@4076e940; line: 1,
column: 1]; nested exception is org.codehaus.jackson.map.JsonMappingException:
Can not deserialize instance of MyObject out of START_ARRAY token
at [Source: org.apache.http.conn.EofSensorInputStream@4076e940; line: 1, column: 1]
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:466)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:414)
at org.springframework.web.client.RestTemplate.getForEntity(RestTemplate.java:234)
at com.be.android.locateconsultants.resources.AsyncTaskRESTServiceCaller.doInBackground(AsyncTaskRESTServiceCaller.java:43)
at com.be.android.locateconsultants.resources.AsyncTaskRESTServiceCaller.doInBackground(AsyncTaskRESTServiceCaller.java:1)
at android.os.AsyncTask$2.call(AsyncTask.java:252)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
... 4 more
Caused by: org.codehaus.jackson.map.JsonMappingException: Can not deserialize
instance of MyObject out of START_ARRAY token
at [Source: org.apache.http.conn.EofSensorInputStream@4076e940; line: 1, …Run Code Online (Sandbox Code Playgroud)