Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

com.fasterxml.jackson.databind.exc.InvalidFormatException #6

Closed
robmool opened this issue Apr 13, 2018 · 2 comments
Closed

com.fasterxml.jackson.databind.exc.InvalidFormatException #6

robmool opened this issue Apr 13, 2018 · 2 comments
Assignees

Comments

@robmool
Copy link

robmool commented Apr 13, 2018

Hi,

I get the following error message when sending a simple mail using the latest library.

Track trace:
com.fasterxml.jackson.databind.exc.InvalidFormatException: Can not deserialize value of type java.util.Date from String "2018-04-13T14:50:37.4008047-04:00": not a valid representation (error: Failed to parse Date value '2018-04-13T14:50:37.4008047-04:00': Can not parse date "2018-04-13T14:50:37.4008047-0400": while it seems to fit format 'yyyy-MM-dd'T'HH:mm:ss.SSSZ', parsing fails (leniency? null))
at [Source: {"To":"robm@dci.es","SubmittedAt":"2018-04-13T14:50:37.4008047-04:00","MessageID":"46f56d35-e169-4efa-a12d-160726177ae9","ErrorCode":0,"Message":"OK"}; line: 1, column: 35] (through reference chain: com.wildbit.java.postmark.client.data.model.message.MessageResponse["SubmittedAt"])
at com.fasterxml.jackson.databind.exc.InvalidFormatException.from(InvalidFormatException.java:74)
at com.fasterxml.jackson.databind.DeserializationContext.weirdStringException(DeserializationContext.java:1410)
at com.fasterxml.jackson.databind.DeserializationContext.handleWeirdStringValue(DeserializationContext.java:926)
at com.fasterxml.jackson.databind.deser.std.StdDeserializer._parseDate(StdDeserializer.java:819)
at com.fasterxml.jackson.databind.deser.std.StdDeserializer._parseDate(StdDeserializer.java:788)
at com.fasterxml.jackson.databind.deser.std.DateDeserializers$DateBasedDeserializer._parseDate(DateDeserializers.java:172)
at com.fasterxml.jackson.databind.deser.std.DateDeserializers$DateDeserializer.deserialize(DateDeserializers.java:259)
at com.fasterxml.jackson.databind.deser.std.DateDeserializers$DateDeserializer.deserialize(DateDeserializers.java:242)
at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:504)
at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:104)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:276)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:140)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3814)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2858)
at com.wildbit.java.postmark.client.data.DataHandler.fromJson(DataHandler.java:47)
at com.wildbit.java.postmark.client.ApiClient.deliverMessage(ApiClient.java:56)

Any suggestions?

Thanks in advance,
Rob

@ibalosh
Copy link
Contributor

ibalosh commented Apr 19, 2018

Hi Rob

we noticed users receiving that one from time to time, due older version of Jackson library which handles parsing API responses. Updating library will resolve it.

They fixed it in version 2.9.2. It happens since Jackson does not parse "fractional" timezone correctly. Using up to date library should fix this issue.

https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.9.2

@ibalosh ibalosh self-assigned this Apr 19, 2018
@ibalosh
Copy link
Contributor

ibalosh commented Apr 19, 2018

Hi Rob,

meanwhile, I investigated this issue bit more. I noticed that on my side, jackson annotations were still using version 2.9.0 . I pushed a very small release which should force them to match 2.9.5 version.

Although this did not affect parsing on my side, (it worked fine before too) I am hoping strict versions for jackson provider and annotation to resolve this issue.

@ibalosh ibalosh closed this as completed Apr 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants