Note that there are some explanatory texts on larger screens.

plurals
  1. POException converting a Json retrieved from Oracle Apex to a POJO with Spring & Jackson
    primarykey
    data
    text
    <p>we have a rest web service with Oracle 11g and Apex on the server side. On the client side we are developing for android, and using Spring 1.0.1 and Jackson 2.2.3 libraries to manage the requests of the rest webservices and convert the json data back into a pojo.</p> <p>It works very well when the webservice is a "query". The resultset-Json data is converted in an array of Pojos without problem. But when we try to do the same with a oracle procedure, it fails with an exception.</p> <p>The Json data returned by the procedure is the following:</p> <pre><code>{"item":"{\r\n \"user\" : \"{john}\",\r\n \"profile\" : \"nothing\"\r\n}"} </code></pre> <p>I tried an online Json validator, and the Json data appears to be valid. In the header you can also see that the type is "application/json".</p> <p>The pojo object is as follows:</p> <pre><code> public class User { public String getUser() { return user; } public void setUser(String user) { this.user = user; } private String user; public String getProfile() { return profile; } public void setProfile(String profile) { this.profile = profile; } private String profile; } </code></pre> <p>The code that calls the webservice and tries to convert json to pojo is the following (copied from the spring examples):</p> <pre><code>RestTemplate restTemplate = new RestTemplate(); restTemplate.getMessageConverters().add(new MappingJackson2HttpMessageConverter()); User users = restTemplate.getForObject(url, User.class); </code></pre> <p>And at last, the exception when it tries to do "getForObject":</p> <pre><code>org.springframework.web.client.RestClientException: Could not extract response: no suitable HttpMessageConverter found for response type [com.xxx.xxx] and content type [text/plain;charset=iso-8859-1] </code></pre> <p>I tried to do the same with the Gson library instead the Jackson library, and the same exception is trown. Now I'm blocked since a couple of days...</p> <p>Any ideas? What I'm doing wrong?</p> <p>Thanks in advance,</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload