Hi All,

When i invoke the postForObject () method i got exception in my android application.

My code is:

String url = "http://localhost:8080/rest/login";

Sample sam = new Sample ();
sam.setUserID("User1");
sam.setPassword("password");

RestTemplate restTemplate = new RestTemplate(new CommonsClientHttpRequestFactory());

ResponseType ms = new ResponseType ();

ms = restTemplate.postForObject(url, mp, MySession.class); ---> when the control comes here i got below exception..


Caused by: org.springframework.web.client.RestClientException : Could not write request: no suitable HttpMessageConverter found for request type [Sample ]


Please help me to solve the above problem.

Thanks in advance,
Kumaresan