paymill / paymill-java

Java wrapper for Paymill API
http://paymill.github.io
MIT License
26 stars 22 forks source link

Can not deserialize instance of com.paymill.models.Payment out of START_ARRAY token #46

Closed simplysoft closed 10 years ago

simplysoft commented 10 years ago

Using the latest 3.1.1 version, we get the following exception

java.lang.RuntimeException: com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of com.paymill.models.Payment out of START_ARRAY token
 at [Source: java.io.StringReader@65bad9fe; line: 1, column: 960] (through reference chain: com.paymill.models.Client["subscription"]->com.paymill.models.Subscription["payment"])
    at com.paymill.services.RestfulUtils.deserializeObject(RestfulUtils.java:97)
    at com.paymill.services.RestfulUtils.show(RestfulUtils.java:46)
    at com.paymill.services.ClientService.get(ClientService.java:84)
    at com.paymill.services.ClientService.get(ClientService.java:94)
[snip]
Caused by: com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of com.paymill.models.Payment out of START_ARRAY token
 at [Source: java.io.StringReader@65bad9fe; line: 1, column: 960] (through reference chain: com.paymill.models.Client["subscription"]->com.paymill.models.Subscription["payment"])
    at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:164)
    at com.fasterxml.jackson.databind.DeserializationContext.mappingException(DeserializationContext.java:691)
    at com.fasterxml.jackson.databind.DeserializationContext.mappingException(DeserializationContext.java:685)
    at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromArray(BeanDeserializerBase.java:1215)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeOther(BeanDeserializer.java:151)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:126)
    at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:525)
    at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:99)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:242)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:118)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:227)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:204)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:23)
    at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:525)
    at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:99)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:242)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:118)
    at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:2993)
    at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2098)
    at com.paymill.services.RestfulUtils.deserializeObject(RestfulUtils.java:90)
    ... 13 more
d0mme-zz commented 10 years ago

@stoilkov: Can you please take a look at this issue? Thanks.

stoilkov commented 10 years ago

Thanks for reporting this. There is a problem with the API, which affects 3.1 and previous versions of the wrapper. Fix is under way, no change in the wrapper will be needed. I will leave this issue open, until the issue is fixed.

stoilkov commented 10 years ago

The issue has been resolved. @simplysoft can you confirm this?

simplysoft commented 10 years ago

No, the problem is still not resolved. We did try it again and get exactly the same error.

d0mme-zz commented 10 years ago

@stoilkov: Please have a look at this issue then from @simplysoft.

stoilkov commented 10 years ago

@simplysoft the issue has been fixed, can you confirm this? Thanks.

simplysoft commented 10 years ago

Seems to be fixed

stoilkov commented 10 years ago

Thanks @simplysoft .