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
[Bug 509535] New: java.lang.NoClassDefFoundError: com/google/gson/annotations/JsonAdapter #44
Comments
@spoenemann could you check is the generated manifest contains proper imports for the mentioned package? |
The generated manifest does not have an import for See the top of the stack:
|
The Gson code where the exception occurs is this:
Could it be that |
Ok, so than it seems to be an issue in the manifest of latest gson in orbit. |
Should we add a package import of |
Maybe the issue isn't caused by GSon per se, but by having multiple versions of GSon in the OSGi runtime (and maybe different involved bundles loading different version of the class). |
Maybe to clarify. Problem is visible ONLY when LSP4E is installed on the top of Oxygen when two version of gson are available:
When older version (2.2.4) is removed manually then LSP4E also works ok. With Neon.2 everything works fine. |
Ok, so maybe this highlights that gson should be marked as a singleton? |
The manifest of Gson 2.7 from Orbit says
I think this is a bug. |
I think it is indeed the bug. Either the package should not be imported, or it should be imported with a version constraint. |
@mickaelistria Than we should report it in gson issue tracker and see what they say. |
I opened google/gson#1001 to GSon |
But the manifest is generated by Orbit, not by Gson. It says:
|
But the meta information provided is copied from http://repo1.maven.org/maven2/com/google/code/gson/gson/2.6.2/ |
I just found an issue for 2.8 google/gson#957 |
@mickaelistria I will provide a patch for orbit gson. I tend to remove the import rather than add a version constraint. It seems to be common to import own packages in BND, but it not really common to do it in equinox. |
Fix will be part of Oxygen M6 |
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=509535
The text was updated successfully, but these errors were encountered: