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

Incompatible with jackson 2.12.1 #6

Closed
debovema opened this issue Jul 8, 2021 · 12 comments
Closed

Incompatible with jackson 2.12.1 #6

debovema opened this issue Jul 8, 2021 · 12 comments

Comments

@debovema
Copy link

debovema commented Jul 8, 2021

I'm having the same issue as emfjson/emfjson-jackson#114.

Is there a fix or shall we declare some custom Jackson ObjectMapper ?

cc @juergen-albert @kentxu

@juergen-albert
Copy link

I looked into the issue but couldn't really make heads or tails out of if. At some point TypeFactory.constructReferenceType is called and in the latest Version of jackson the validation became stricter. It might be an easy fix for someone who knows what he is doing in this context.

@ghillairet can you have a look and or point me to the right direction? It is easy to reproduce, because the tests fail with the same error, when the version of jackson is lifted. Any Kind of fix should also work with older versions of jackson, as far as I can see.

@debovema
Copy link
Author

debovema commented Jul 8, 2021

It might be an easy fix for someone who knows what he is doing in this context.

Totally agree :)

@vhemery
Copy link
Contributor

vhemery commented Jul 22, 2021

The exact modification introducing this regression is
FasterXML/jackson-databind@620d889#diff-d533fdf77cd40a01e6a613580c7a3351b6428109a2b64384d8ad9ea756ce2842

Since 2.12.0 ReferenceType is now parameterized.
But I wonder whether constructReferenceType may be called the wrong way with inverted arguments, since it looks like rawType argument should always be a parameterized type, and in this case we use an EClass' type...

For now, the simplest workaround I found was to use jackson-databind < 2.12 (in my Eclipse target platform). I am now explicitely taking jackson [2.10.3,2.12.0) from http://download.eclipse.org/releases/2020-12, whereas before, 2.12.1 was implicitely taken from http://download.eclipse.org/releases/2021-03 as requirements from my included features (with includeMode="planner").

@ghillairet
Copy link
Contributor

Thanks everyone for looking at this.
I have a PR #7 for it that seems to fix it, if anyone wants to look at it.
The trick was to switch parameters for the constructReferenceType method and put a type parameter to EcoreType.ReferenceType.
Tests are now passing for both pre 2.12 and 2.12+ versions.

@jtrentes
Copy link

jtrentes commented Aug 18, 2021

@ghillairet we have the same problem on our project and your fix works for us (thanks!). Did you know when the version 1.3.1 will be released?

@planger
Copy link
Contributor

planger commented Aug 18, 2021

We are currently in the last steps of setting up the build on Eclipse.
The basic build is more or less ready:
https://ci.eclipse.org/emfcloud/job/eclipse-emfcloud/job/emfjson-jackson/job/build-infra-v1/lastSuccessfulBuild/artifact/p2-update-site/emf-jackson/p2/nightly
I think what's still missing is the publishing step, but I'll have to double-check with @sgraband.
As soon as this is done, a nightly build will be available immediately for you to consume.
After that we'll trigger the release review at the Eclipse foundation to be able to do proper releases.

@Xaelis
Copy link

Xaelis commented Sep 1, 2021

Can you confirm the 1.3.1 has been deployed? Still can't find it on maven repository.
Thank you!

@planger
Copy link
Contributor

planger commented Sep 1, 2021

Yes, the CI work has been finished and the nightly P2 repository now provides the build results after each change in master. So the snapshot versions of 1.3.1 are available via https://download.eclipse.org/emfcloud/emfjson-jackson/p2/nightly

Please note that due to the rules of the Eclipse foundation, we had to change the namespace to org.eclipse.emfcloud.emfjson-jackson. Thus, minor changes will be required when switching to this version from the old one.

We'll trigger the release review in the next weeks to be able to do the first official release as an Eclipse project.

@planger
Copy link
Contributor

planger commented Sep 1, 2021

Can you confirm the 1.3.1 has been deployed? Still can't find it on maven repository.
Thank you!

Oh, now I realize you are looking for the m2 dependency. We've only finished the publishing pipeline for the p2 repository at the moment. I'll clarify whether we can also publish the m2 bundles to maven central for nightly builds.

@planger
Copy link
Contributor

planger commented Sep 1, 2021

Can you confirm the 1.3.1 has been deployed? Still can't find it on maven repository.
Thank you!

Oh, now I realize you are looking for the m2 dependency. We've only finished the publishing pipeline for the p2 repository at the moment. I'll clarify whether we can also publish the m2 bundles to maven central for nightly builds.

As it turns out, the nightly builds are already available as m2 via https://oss.sonatype.org/content/repositories/snapshots/org/eclipse/emfcloud/emfjson-jackson/

@kentxu
Copy link

kentxu commented Sep 16, 2021

Yes, the CI work has been finished and the nightly P2 repository now provides the build results after each change in master. So the snapshot versions of 1.3.1 are available via https://download.eclipse.org/emfcloud/emfjson-jackson/p2/nightly

Please note that due to the rules of the Eclipse foundation, we had to change the namespace to org.eclipse.emfcloud.emfjson-jackson. Thus, minor changes will be required when switching to this version from the old one.

We'll trigger the release review in the next weeks to be able to do the first official release as an Eclipse project.

I can also confirm the nightly build seems to fix the problems. Tested on eclipse 2021-09 w/ jackson 2.12.1. --> thank you very much!!!

@tortmayr tortmayr closed this as completed Dec 5, 2021
@ruspl-afed
Copy link

Hmm, I can observe the same issue with jackson 2.12.6 and jackson 2.13.1, while jackson 2.11.4 works for me

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

10 participants