My codes hangs when creating a new MappingJacksonHttpMessageConverter. I am running on Android 4.1.2. The code is below
public void login(String empCode, String password) {
RestTemplate rt = new RestTemplate();
MappingJacksonHttpMessageConverter jackson = new MappingJacksonHttpMessageConverter();
try{
rt.getMessageConverters().add(jackson);
rt.getMessageConverters().add(new StringHttpMessageConverter());
} catch(Exception ex) {
ex.printStackTrace();
}
String uri = new String("http://43.68.85.137:8080/cimweb/api/authenticateEmployee");
Employee employee = new Employee();
employee.setEmpCode(empCode);
employee.setPassword(password);
employee.setAuthenticUser(false);
Employee returns = rt.postForObject(uri, employee, Employee.class);}
and here is the log
08-14 16:11:41.250: E/dalvikvm(15517): Could not find class 'org.codehaus.jackson.map.ObjectMapper', referenced from method org.springframework.http.converter.json.MappingJacksonHttpMessageConverter. 08-14 16:11:41.250: W/dalvikvm(15517): VFY: unable to resolve new-instance 807 (Lorg/codehaus/jackson/map/ObjectMapper;) in Lorg/springframework/http/converter/json/MappingJacksonHttpMessageConverter; 08-14 16:11:41.250: D/dalvikvm(15517): VFY: replacing opcode 0x22 at 0x000e