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

ClassJsonAdapter throws AssertionError without wrapping IllegalAccessException #1523

Closed
dvmarcilio opened this issue Mar 3, 2022 · 3 comments
Labels

Comments

@dvmarcilio
Copy link

dvmarcilio commented Mar 3, 2022

I'm getting an AssertionError without any message from ClassJsonAdapter.fromJson() in Java.
I would like to investigate the root cause of the issue, but unfortunately, the exception message doesn't provide any hints.

ClassJsonAdapter (and others classes) throws an AssertionError when an IllegalAccessException is caught.

} catch (e: IllegalAccessException) {
throw AssertionError()
}

} catch (e: IllegalAccessException) {
throw AssertionError()
}

Should the IllegalAccessException be wrapped in the AssertionError like, for instance, in RecordJsonAdapter?

} catch (e: IllegalAccessException) {
throw AssertionError(e)
}

@dvmarcilio dvmarcilio added the bug label Mar 3, 2022
@ZacSweers
Copy link
Collaborator

Please link a minimally reproducible sample project

@dvmarcilio
Copy link
Author

I have it working on my original project now.
Thanks.

A short description to maybe help others in the future.
The AssertionError was only happening when executing my application through an uber jar generated by maven-assembly-plugin (jar-with-dependencies).
The fix was to generate the uber jar with maven-shade-plugin instead.

@Puccet
Copy link

Puccet commented Dec 3, 2024

I have the issue but already generating the uber jar with shade, do you have any specific option to use?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants