question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow OffsetDateTime to be parsed from a Double value

See original GitHub issue

In version 2.14.1, changes to handlling of OffsetDateTime type values was introduced to persist timezone. Earlier, OffsetDateTime type values were converted to a double type for storage and converted back to OffsetDateTime type on retrieval.

The earlier versions also were able to retrieve values stored as OffsetDateTime strings. Starting v2.14.1, during retrieval, the double type values are not parsed by the library and throw a DateTimeParseException.

exception: java.time.format.DateTimeParseException: Text '1657220671.920877' could not be parsed at index 0
	... 5 common frames omitted
Wrapped by: com.fasterxml.jackson.data.JsonMappingException: Text '1657220671.920877' could not be parsed at index 0 (through reference chain: com.company.org.project.service.api.v1_0.model.Schedule["triggerTime"])
	... 5 common frames omitted
Wrapped by: java.lang.IllegalArgumentException: The given string value: {"triggerTime": 1657220671.920877} cannot be transformed to Json object
	... 5 common frames omitted
Wrapped by: org.hibernate.HibernateException: java.lang.IllegalArgumentException: The given string value: {"triggerTime": 1657220671.920877} cannot be transformed to Json object
	... 5 common frames omitted
Wrapped by: org.springframework.orm.jpa.JpaSystemException: java.lang.IllegalArgumentException: The given string value: {"triggerTime": 1657220671.920877} cannot be transformed to Json object; nested exception is org.hibernate.HibernateException: java.lang.IllegalArgumentException: The given string value: {"triggerTime": 1657220671.920877} cannot be transformed to Json object
	at...

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
vladmihalceacommented, Jul 26, 2022

Fixed.

0reactions
vladmihalceacommented, Jul 23, 2022

After adding the dependency:

<dependency>
	<groupId>com.fasterxml.jackson.datatype</groupId>
	<artifactId>jackson-datatype-jsr310</artifactId>
	<version>${jackson-module-jaxb-annotation}</version>
</dependency>

I could, indeed, replicate the issue you mentioned.

DEBUG [Alice]: n.t.d.l.l.SLF4JQueryLoggingListener - Name:DATA_SOURCE_PROXY, Connection:4, Time:7, Success:True, Type:Prepared, Batch:False, QuerySize:1, BatchSize:0, Query:["insert into event (location, id) values (?, ?)"], Params:[({"country":"Romania","city":"Cluj-Napoca","reference":null,"rentedAt":1443682800.000000000}, 1)]

I’ll integrate it for 2.17.1.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jackson: parse custom offset date time - Stack Overflow
You must tell Jackson in what format the date is. Basically, you have year-month-day followed by hour:minute:second.microseconds and the ...
Read more >
OffsetDateTime (Java Platform SE 8 ) - Oracle Help Center
OffsetDateTime is an immutable representation of a date-time with an offset. This class stores all date and time fields, to a precision of...
Read more >
Converting Java Date to OffsetDateTime - Baeldung
In this tutorial, we learn about the difference between Date and OffsetDateTime. We also learn how to convert from one to the other....
Read more >
java.time.OffsetDateTime.parse() Example - Program Talk
OffsetDateTime.parse() taken from open source projects. ... @Test public void testGetOffsetDateTimeConverter() { OffsetDateTime value = config.
Read more >
OffsetDateTime - Android Developers
OffsetDateTime adds to the instant the offset from UTC/Greenwich, which allows the local date-time to be obtained. ZonedDateTime adds full time-zone rules.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found