You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@usergrid.apache.org by krish Bhaya <kr...@gmail.com> on 2014/06/20 17:05:52 UTC

Could not write request: no suitable HttpMessageConverter

Hi All,

I am trying to do a sample by using Java SDK I am getting above exception.

I have tried the same request through the REST Client and it was working
fine. But through the SDK I have to do some changes to have the same
request url.

I have created the organization,application and an user through the rest
client.Then I tried to create another user by following request details:

url: *http://localhost:8080/{organization
<http://localhost:8080/{organization> Name}/{app Name}/users*

I have tried standalone app and the code is as following:











*public class UsergridClient {        public static void main(String[]
args) {                Client client = new Client("krishbugi",
"Krish01_APP");
client.setAccessToken("YWMtt-bcqPhxEeOxKluI7OR-3QAAAUbdLc5I84j299DkFj4juTGp3BDLp1G12R8");
            client.createUser("krish", "krishanthi", "krish@gmail.com
<kr...@gmail.com>", "abc123");
//client.authorizeAppUser("krish@gmail.com <kr...@gmail.com>",
"abc123");    }}*

When converting the response I am getting following exception:

*Exception in thread "main"
org.springframework.web.client.RestClientException: Could not write
request: no suitable HttpMessageConverter found for request type
[java.util.HashMap] and content type [application/json]*


I have added "com.fasterxml.jackson.databind.jar" to the classpath too.

Would appreciate if you can suggest a solution for this issue.

Thank you.