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

Datatype module support to make Jackson recognize Java 8 Date & Time #551

Merged
merged 3 commits into from
Nov 1, 2023

Conversation

pavelvic
Copy link
Contributor

@pavelvic pavelvic commented Oct 9, 2023

Hi! There is no feature for parsing Java 8 Date & Time formats.

IIf we try to deserialize string obj "2023-10-06T18:29:50.138+03:00" to object of class OffsetDateTime, we have the exception "com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Java 8 date/time type java.time.OffsetDateTime not supported by default: add Module "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to enable handling".

So this PR add this feature to your wonderful library

@oberstet
Copy link
Contributor

oberstet commented Oct 9, 2023

great, thanks for contributing! this change looks straight forward and good - however, the CI fails for some tools/SDK issues .. not sure what's the matter ..

@om26er
Copy link
Contributor

om26er commented Oct 9, 2023

I think we should try a restart of the CI first.

@pavelvic
Copy link
Contributor Author

Following this

Exception in thread "main" java.lang.UnsupportedClassVersionError: com/android/prefs/AndroidLocationsProvider has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

It looks like your CI-pipeline uses Java 11 (major Java version = 55) for compiling class com/android/prefs/AndroidLocationsProvider, and then CI-pipeline try to run compiled code using Java 8 (major Java version = 52).
Can you try to fix your CI? Unfortunately, I can't do this because I don't have necessary skills :(

Maybe it helps - https://www.baeldung.com/java-lang-unsupportedclassversion

@pavelvic
Copy link
Contributor Author

Here is issue from android-actions repo. There is no problem solving. But people say, that it happens sporadically. So maybe restart of the CI can help. If you can, try to restart please
android-actions/setup-android#378

@oberstet
Copy link
Contributor

fwiw, I've restarted this PR's CI jobs, lets see. I think this needs update to grab "the new" java thing for running this CI https://github.com/crossbario/autobahn-java/blob/master/.github/workflows/main.yml

@pavelvic pavelvic closed this Oct 18, 2023
@pavelvic pavelvic deleted the feature/jsr310 branch October 18, 2023 17:59
@pavelvic pavelvic restored the feature/jsr310 branch October 18, 2023 18:03
@pavelvic pavelvic reopened this Oct 18, 2023
@pavelvic
Copy link
Contributor Author

pavelvic commented Oct 18, 2023

Hi! I fix the pipeline in my fork! The problem was in Java version. This action 'android-actions/setup-android@v2' installs Android SDK. And it requires Java 11 at the environment. Unfortunately, I can't find why it requires Java 11. May be there are some changes in 'android-actions/setup-android@v2' or in the Android SDK. I have changed the java version in pipeline from 8 to 11 and it works. There is a result of running this pipeline in my fork - succeeded: https://github.com/pavelvic/autobahn-java/actions/runs/6564538141/job/17831094583
So, if you merge this PR, the pipeline must work :)

@pavelvic
Copy link
Contributor Author

So, do you still need this feature? Or should I close this PR?

Copy link
Contributor

@om26er om26er left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good

@oberstet oberstet merged commit 1743bb2 into crossbario:master Nov 1, 2023
1 check passed
@oberstet
Copy link
Contributor

oberstet commented Nov 1, 2023

@pavelvic sorry for the delay, merged. thanks for contributing!

@pavelvic pavelvic deleted the feature/jsr310 branch November 1, 2023 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants