Quantcast

jackson json mapping issue

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

jackson json mapping issue

suchitha koneru
Hello Jersey Users,
       We are using  jersey-server, jersery -client and jersey-json jars of  version 1.11  in our application which runs on  a jetty server. I get the following exception when json is being deserialized into Retailer pojo (the pojo is attached and it is generated by using xjc compiler from Retailer XSD).  Both Retailer  and Retailer countrty pojos have a inner class Supported Currencies with different definition. I think this is causing the issue.

 
Caused by: org.codehaus.jackson.map.JsonMappingException: Can not deserialize instance of com.bn.cloud.pm.data.vo.catalog.retl.Retailer$SupportedCurrencies out of START_ARRAY token
 at [Source: java.io.ByteArrayInputStream@3bdd6a67; line: 1, column: 101] (through reference chain: com.bn.cloud.pm.data.vo.catalog.retl.Retailer["supportedCurrencies"])
at org.codehaus.jackson.map.JsonMappingException.from(JsonMappingException.java:163) ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
at org.codehaus.jackson.map.deser.StdDeserializationContext.mappingException(StdDeserializationContext.java:219) ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
at org.codehaus.jackson.map.deser.StdDeserializationContext.mappingException(StdDeserializationContext.java:212) ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
at org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromArray(BeanDeserializer.java:869) ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
at org.codehaus.jackson.map.deser.BeanDeserializer.deserialize(BeanDeserializer.java:597) ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
at org.codehaus.jackson.map.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:299) ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
at org.codehaus.jackson.map.deser.SettableBeanProperty$FieldProperty.deserializeAndSet(SettableBeanProperty.java:579) ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
at org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:697) ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
at org.codehaus.jackson.map.deser.BeanDeserializer.deserialize(BeanDeserializer.java:580) ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
at org.codehaus.jackson.map.ObjectMapper._readValue(ObjectMapper.java:2695) ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1308) ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
at org.codehaus.jackson.jaxrs.JacksonJsonProvider.readFrom(JacksonJsonProvider.java:419) ~[jackson-jaxrs-1.9.2.jar:1.9.2]
at com.sun.jersey.json.impl.provider.entity.JacksonProviderProxy.readFrom(JacksonProviderProxy.java:139) ~[jersey-json-1.11.jar:1.11]
at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:554) ~[jersey-client-1.11.jar:1.11]

I suspect the issue is 



I am not aware of any work arounds. Could you please suggest what can be done to solve this issue ? 


Thank you,
Suchitha





 
 

Retailer.java (13K) Download Attachment
RetailerCountry.java (27K) Download Attachment
Retailer.xsd (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: jackson json mapping issue

suchitha koneru
Not sure if the mail was sent to the user group the first time as I did not see it in my inbox.

On Tue, Jun 26, 2012 at 11:12 AM, suchitha koneru <[hidden email]> wrote:
Hello Jersey Users,
       We are using  jersey-server, jersery -client and jersey-json jars of  version 1.11  in our application which runs on  a jetty server. I get the following exception when json is being deserialized into Retailer pojo (the pojo is attached and it is generated by using xjc compiler from Retailer XSD).  Both Retailer  and Retailer countrty pojos have a inner class Supported Currencies with different definition. I think this is causing the issue.

 
Caused by: org.codehaus.jackson.map.JsonMappingException: Can not deserialize instance of com.bn.cloud.pm.data.vo.catalog.retl.Retailer$SupportedCurrencies out of START_ARRAY token
 at [Source: java.io.ByteArrayInputStream@3bdd6a67; line: 1, column: 101] (through reference chain: com.bn.cloud.pm.data.vo.catalog.retl.Retailer["supportedCurrencies"])
at org.codehaus.jackson.map.JsonMappingException.from(JsonMappingException.java:163) ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
at org.codehaus.jackson.map.deser.StdDeserializationContext.mappingException(StdDeserializationContext.java:219) ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
at org.codehaus.jackson.map.deser.StdDeserializationContext.mappingException(StdDeserializationContext.java:212) ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
at org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromArray(BeanDeserializer.java:869) ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
at org.codehaus.jackson.map.deser.BeanDeserializer.deserialize(BeanDeserializer.java:597) ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
at org.codehaus.jackson.map.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:299) ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
at org.codehaus.jackson.map.deser.SettableBeanProperty$FieldProperty.deserializeAndSet(SettableBeanProperty.java:579) ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
at org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:697) ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
at org.codehaus.jackson.map.deser.BeanDeserializer.deserialize(BeanDeserializer.java:580) ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
at org.codehaus.jackson.map.ObjectMapper._readValue(ObjectMapper.java:2695) ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1308) ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
at org.codehaus.jackson.jaxrs.JacksonJsonProvider.readFrom(JacksonJsonProvider.java:419) ~[jackson-jaxrs-1.9.2.jar:1.9.2]
at com.sun.jersey.json.impl.provider.entity.JacksonProviderProxy.readFrom(JacksonProviderProxy.java:139) ~[jersey-json-1.11.jar:1.11]
at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:554) ~[jersey-client-1.11.jar:1.11]

I suspect the issue is 



I am not aware of any work arounds. Could you please suggest what can be done to solve this issue ? 


Thank you,
Suchitha





 
 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: jackson json mapping issue

Cowtowncoder
I don't know what the issue is, but I do not think the Jira issue you
reference is related, as I don't see any generic type declarations.
The underlying issue is exactly what error message says: a POJO is
typically serialized out of JSON Object, but what JSON has is an
array. You may want to check out what kind of JSON is being given to
deserializer, and see why it does not match. One possibility is
addition of JSON type information.

-+ Tatu +-

On Wed, Jun 27, 2012 at 9:58 AM, suchitha koneru <[hidden email]> wrote:

> Not sure if the mail was sent to the user group the first time as I did not
> see it in my inbox.
>
>
> On Tue, Jun 26, 2012 at 11:12 AM, suchitha koneru <[hidden email]>
> wrote:
>>
>> Hello Jersey Users,
>>        We are using  jersey-server, jersery -client and jersey-json jars
>> of  version 1.11  in our application which runs on  a jetty server. I get
>> the following exception when json is being deserialized into Retailer pojo
>> (the pojo is attached and it is generated by using xjc compiler from
>> Retailer XSD).  Both Retailer  and Retailer countrty pojos have a inner
>> class Supported Currencies with different definition. I think this is
>> causing the issue.
>>
>>
>> Caused by: org.codehaus.jackson.map.JsonMappingException: Can not
>> deserialize instance of
>> com.bn.cloud.pm.data.vo.catalog.retl.Retailer$SupportedCurrencies out of
>> START_ARRAY token
>>  at [Source: java.io.ByteArrayInputStream@3bdd6a67; line: 1, column: 101]
>> (through reference chain:
>> com.bn.cloud.pm.data.vo.catalog.retl.Retailer["supportedCurrencies"])
>> at
>> org.codehaus.jackson.map.JsonMappingException.from(JsonMappingException.java:163)
>> ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
>> at
>> org.codehaus.jackson.map.deser.StdDeserializationContext.mappingException(StdDeserializationContext.java:219)
>> ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
>> at
>> org.codehaus.jackson.map.deser.StdDeserializationContext.mappingException(StdDeserializationContext.java:212)
>> ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
>> at
>> org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromArray(BeanDeserializer.java:869)
>> ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
>> at
>> org.codehaus.jackson.map.deser.BeanDeserializer.deserialize(BeanDeserializer.java:597)
>> ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
>> at
>> org.codehaus.jackson.map.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:299)
>> ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
>> at
>> org.codehaus.jackson.map.deser.SettableBeanProperty$FieldProperty.deserializeAndSet(SettableBeanProperty.java:579)
>> ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
>> at
>> org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:697)
>> ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
>> at
>> org.codehaus.jackson.map.deser.BeanDeserializer.deserialize(BeanDeserializer.java:580)
>> ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
>> at
>> org.codehaus.jackson.map.ObjectMapper._readValue(ObjectMapper.java:2695)
>> ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
>> at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1308)
>> ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
>> at
>> org.codehaus.jackson.jaxrs.JacksonJsonProvider.readFrom(JacksonJsonProvider.java:419)
>> ~[jackson-jaxrs-1.9.2.jar:1.9.2]
>> at
>> com.sun.jersey.json.impl.provider.entity.JacksonProviderProxy.readFrom(JacksonProviderProxy.java:139)
>> ~[jersey-json-1.11.jar:1.11]
>> at
>> com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:554)
>> ~[jersey-client-1.11.jar:1.11]
>>
>> I suspect the issue is
>>
>> http://jira.codehaus.org/browse/JACKSON-743
>>
>>
>> I am not aware of any work arounds. Could you please suggest what can be
>> done to solve this issue ?
>>
>>
>> Thank you,
>> Suchitha
>>
>>
>>
>>
>>
>>
>>
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: jackson json mapping issue

suchitha koneru
Thanks Tatu for the response.  I have inner classes  , can this be a issue for derserialization as stated in the 

The class Retailer and its Data member  RetailerCountries  both have a static inner class of same name" Supported Currencies" but  with different definitions. 

can this be a problem ?
 


On Wed, Jun 27, 2012 at 10:18 AM, Tatu Saloranta <[hidden email]> wrote:
I don't know what the issue is, but I do not think the Jira issue you
reference is related, as I don't see any generic type declarations.
The underlying issue is exactly what error message says: a POJO is
typically serialized out of JSON Object, but what JSON has is an
array. You may want to check out what kind of JSON is being given to
deserializer, and see why it does not match. One possibility is
addition of JSON type information.

-+ Tatu +-

On Wed, Jun 27, 2012 at 9:58 AM, suchitha koneru <[hidden email]> wrote:
> Not sure if the mail was sent to the user group the first time as I did not
> see it in my inbox.
>
>
> On Tue, Jun 26, 2012 at 11:12 AM, suchitha koneru <[hidden email]>
> wrote:
>>
>> Hello Jersey Users,
>>        We are using  jersey-server, jersery -client and jersey-json jars
>> of  version 1.11  in our application which runs on  a jetty server. I get
>> the following exception when json is being deserialized into Retailer pojo
>> (the pojo is attached and it is generated by using xjc compiler from
>> Retailer XSD).  Both Retailer  and Retailer countrty pojos have a inner
>> class Supported Currencies with different definition. I think this is
>> causing the issue.
>>
>>
>> Caused by: org.codehaus.jackson.map.JsonMappingException: Can not
>> deserialize instance of
>> com.bn.cloud.pm.data.vo.catalog.retl.Retailer$SupportedCurrencies out of
>> START_ARRAY token
>>  at [Source: java.io.ByteArrayInputStream@3bdd6a67; line: 1, column: 101]
>> (through reference chain:
>> com.bn.cloud.pm.data.vo.catalog.retl.Retailer["supportedCurrencies"])
>> at
>> org.codehaus.jackson.map.JsonMappingException.from(JsonMappingException.java:163)
>> ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
>> at
>> org.codehaus.jackson.map.deser.StdDeserializationContext.mappingException(StdDeserializationContext.java:219)
>> ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
>> at
>> org.codehaus.jackson.map.deser.StdDeserializationContext.mappingException(StdDeserializationContext.java:212)
>> ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
>> at
>> org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromArray(BeanDeserializer.java:869)
>> ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
>> at
>> org.codehaus.jackson.map.deser.BeanDeserializer.deserialize(BeanDeserializer.java:597)
>> ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
>> at
>> org.codehaus.jackson.map.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:299)
>> ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
>> at
>> org.codehaus.jackson.map.deser.SettableBeanProperty$FieldProperty.deserializeAndSet(SettableBeanProperty.java:579)
>> ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
>> at
>> org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:697)
>> ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
>> at
>> org.codehaus.jackson.map.deser.BeanDeserializer.deserialize(BeanDeserializer.java:580)
>> ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
>> at
>> org.codehaus.jackson.map.ObjectMapper._readValue(ObjectMapper.java:2695)
>> ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
>> at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1308)
>> ~[jackson-mapper-asl-1.9.2.jar:1.9.2]
>> at
>> org.codehaus.jackson.jaxrs.JacksonJsonProvider.readFrom(JacksonJsonProvider.java:419)
>> ~[jackson-jaxrs-1.9.2.jar:1.9.2]
>> at
>> com.sun.jersey.json.impl.provider.entity.JacksonProviderProxy.readFrom(JacksonProviderProxy.java:139)
>> ~[jersey-json-1.11.jar:1.11]
>> at
>> com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:554)
>> ~[jersey-client-1.11.jar:1.11]
>>
>> I suspect the issue is
>>
>> http://jira.codehaus.org/browse/JACKSON-743
>>
>>
>> I am not aware of any work arounds. Could you please suggest what can be
>> done to solve this issue ?
>>
>>
>> Thank you,
>> Suchitha
>>
>>
>>
>>
>>
>>
>>
>
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: jackson json mapping issue

Cowtowncoder
On Thu, Jun 28, 2012 at 10:16 AM, suchitha koneru
<[hidden email]> wrote:
> Thanks Tatu for the response.  I have inner classes  , can this be a issue
> for derserialization as stated in the
> JIRA http://jira.codehaus.org/browse/JACKSON-594.
>
> The class Retailer and its Data member  RetailerCountries  both have a
> static inner class of same name" Supported Currencies" but  with different
> definitions.
>
> can this be a problem ?

I don't think so, since your inner classes are static as expected.
[JACKSON-594] was implemented for 1.9 as well; and if it was causing
the failure you would see different exception.

If you can write a stand-alone test (outside of Jersey), I might be
able to help figuring out what exacty is happening.

-+ Tatu +-
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: jackson json mapping issue

suchitha koneru
Thanks Tatu for the suggestion. I followed your advice and tried using the jackson's object mapper explicitly to deserialize the json String , outside of jersey

The following is the json string


{"code":"BN2","name":"proctor and gamble","description":"PG retailer record","retailerGroup":null,"supportedCurrencies":[],"retailerCountries":[{"country":{"code":"US","name":"United States","vat":0.0,"includeTaxInDisplay":false,"currencies":[{"code":"USD","symbol":"$","name":"US Dollar"}]},"defaultCurrency":{"code":"USD","symbol":"$","name":"US Dollar"},"opticsApplied":true,"languages":{"en":"ACTIVE"},"state":"ACTIVE","supportedCurrencies":{"USD":"ACTIVE"},"retailerCountries":[{"type":"SUPPORT","details":{"TEL":"1-800-xxx-xxxx","URL":"http://go.nook.com/support"}},{"type":"HOMEPAGE","details":{"Nook.com":"http://go.nook.com"}},{"type":"BOOKMARK","details":{"Registration":"http://go.nook.com/registration","Nook Blog":"http://go.nook.com/qwk","Facebook":"http://go.nook.com/facebook","YouTube":"http://go.nook.com/youtube","Getting Started":"http://go.nook.com/qwk","Twitter":"http://go.nook.com/twitter"}}],"supportGiftCard":false}],"state":"ACTIVE"}





 Here SupportedCurrencies is an inner static class and we are passing an empty array of supported currencies in the json string. I used the following code

public class TestJson {

     public static void main(String args[]) throws IOException, JsonParseException {

         ObjectMapper objMapper = new ObjectMapper();

        Retailer retailer = objMapper.readValue((new FileInputStream(new File("/Users/skoneru/Documents/retailers/bn2_retailer.txt"))),Retailer.class) ;

     }



I get the following exception 

Exception in thread "main" org.codehaus.jackson.map.JsonMappingException: Can not deserialize instance of com.bn.cloud.pm.data.vo.catalog.retl.Retailer$SupportedCurrencies out of START_ARRAY token
 at [Source: java.io.FileInputStream@424ecfdd; line: 1, column: 96] (through reference chain: com.bn.cloud.pm.data.vo.catalog.retl.Retailer["supportedCurrencies"])
at org.codehaus.jackson.map.JsonMappingException.from(JsonMappingException.java:163)
at org.codehaus.jackson.map.deser.StdDeserializationContext.mappingException(StdDeserializationContext.java:219)
at org.codehaus.jackson.map.deser.StdDeserializationContext.mappingException(StdDeserializationContext.java:212)
at org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromArray(BeanDeserializer.java:869)
at org.codehaus.jackson.map.deser.BeanDeserializer.deserialize(BeanDeserializer.java:597)
at org.codehaus.jackson.map.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:299)
at org.codehaus.jackson.map.deser.SettableBeanProperty$MethodProperty.deserializeAndSet(SettableBeanProperty.java:414)
at org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:697)
at org.codehaus.jackson.map.deser.BeanDeserializer.deserialize(BeanDeserializer.java:580)
at org.codehaus.jackson.map.ObjectMapper._readMapAndClose(ObjectMapper.java:2723)
at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1900)
at com.bn.cloud.pm.rest.resource.TestJson.main(TestJson.java:27)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)



On Thu, Jun 28, 2012 at 11:02 AM, Tatu Saloranta <[hidden email]> wrote:
On Thu, Jun 28, 2012 at 10:16 AM, suchitha koneru
<[hidden email]> wrote:
> Thanks Tatu for the response.  I have inner classes  , can this be a issue
> for derserialization as stated in the
> JIRA http://jira.codehaus.org/browse/JACKSON-594.
>
> The class Retailer and its Data member  RetailerCountries  both have a
> static inner class of same name" Supported Currencies" but  with different
> definitions.
>
> can this be a problem ?

I don't think so, since your inner classes are static as expected.
[JACKSON-594] was implemented for 1.9 as well; and if it was causing
the failure you would see different exception.

If you can write a stand-alone test (outside of Jersey), I might be
able to help figuring out what exacty is happening.

-+ Tatu +-


Retailer.java (13K) Download Attachment
RetailerCountry.java (26K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: jackson json mapping issue

Cowtowncoder
On Thu, Jun 28, 2012 at 1:33 PM, suchitha koneru <[hidden email]> wrote:
> Thanks Tatu for the suggestion. I followed your advice and tried using the
> jackson's object mapper explicitly to deserialize the json String , outside
> of jersey
>
> The following is the json string

And the problem is here:

> {"code":"BN2","name":"proctor and gamble","description":"PG retailer
> record","retailerGroup":null,"supportedCurrencies":[],"retailerCountries":[{"country":

                                                                           ^^^

where value is a JSON array. But SupportedCurrencies is a POJO, and
thus must have something of form:

{ "currency": [ ... ] }

so whatever is producing incoming JSON is producing incompatible JSON.

-+ Tatu +-
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: jackson json mapping issue

suchitha koneru
Thanks a Ton Tatu for pointing out the error.  I am new to JSON and Unfortunately I do not have a handle on what comes in ,  now I undertand why it is failing. Thanks again , appreciate it.

On Thu, Jun 28, 2012 at 2:35 PM, Tatu Saloranta <[hidden email]> wrote:
On Thu, Jun 28, 2012 at 1:33 PM, suchitha koneru <[hidden email]> wrote:
> Thanks Tatu for the suggestion. I followed your advice and tried using the
> jackson's object mapper explicitly to deserialize the json String , outside
> of jersey
>
> The following is the json string

And the problem is here:

> {"code":"BN2","name":"proctor and gamble","description":"PG retailer
> record","retailerGroup":null,"supportedCurrencies":[],"retailerCountries":[{"country":

                                                                          ^^^

where value is a JSON array. But SupportedCurrencies is a POJO, and
thus must have something of form:

{ "currency": [ ... ] }

so whatever is producing incoming JSON is producing incompatible JSON.

-+ Tatu +-

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: jackson json mapping issue

Cowtowncoder
On Thu, Jun 28, 2012 at 2:46 PM, suchitha koneru <[hidden email]> wrote:
> Thanks a Ton Tatu for pointing out the error.  I am new to JSON and
> Unfortunately I do not have a handle on what comes in ,  now I undertand why
> it is failing. Thanks again , appreciate it.

No problem, and good luck!

-+ Tatu +-
Loading...