@Override
public void run() {
for(Location l : this.locations){ //Location is just a simple pojo
String cr = null;
try {
final String s = mapper.writeValueAsString(l);
cr = this.resource
.type(MediaType.APPLICATION_JSON_TYPE)
.accept(MediaType.APPLICATION_JSON_TYPE)
.post(String.class, s);
} catch (JsonProcessingException e) {
logger.error("JSON process error for "+l, e);
}
}
}
2 * Client out-bound request
2 > Content-Type: application/json
2 > Accept: application/json
� �ێ�0 E ��� "_0 ޘD��� �L3����68!0 '-�����y��^��wP��C�4� rg D� � ��� P* B�9�� �!� D� S
�k�W7� [ʶ�6
���GF���3V�� �5�j ւ >}�A� �rf��1Dā�A� �!�B����? lP"�
Exception in thread "pool-4-thread-1" com.sun.jersey.api.client.UniformInterfaceException: Client response status: 411
at com.sun.jersey.api.client.WebResource.handle(WebResource.java:686)
at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
at com.sun.jersey.api.client.WebResource$Builder.post(WebResource.java:568)
at com.katami.concurrent.thread.LocationRestInsertion.run(LocationRestInsertion.java:58)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
2 * Client in-bound response
2 < 411
2 < Server: nginx/0.7.65
2 < Date: Mon, 18 Feb 2013 01:14:30 GMT
2 < Content-Type: text/html
2 < Content-Length: 181
2 < Connection: close
2 <
<html>
<head><title>411 Length Required</title></head>
<body bgcolor="white">
<center><h1>411 Length Required</h1></center>
<hr><center>nginx/0.7.65</center>
</body>
</html>