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

Improve Exception message when default constructor is missing #316

Closed
Simulant87 opened this issue Aug 28, 2019 · 1 comment
Closed

Improve Exception message when default constructor is missing #316

Simulant87 opened this issue Aug 28, 2019 · 1 comment
Milestone

Comments

@Simulant87
Copy link
Contributor

Simulant87 commented Aug 28, 2019

Caused by this issue quarkusio/quarkus#3179

Caused by: javax.json.bind.JsonbException: Internal error: null
	at org.eclipse.yasson.internal.Unmarshaller.deserializeItem(Unmarshaller.java:76)
	at org.eclipse.yasson.internal.Unmarshaller.deserialize(Unmarshaller.java:56)
	at org.eclipse.yasson.internal.JsonBinding.deserialize(JsonBinding.java:53)
	at org.eclipse.yasson.internal.JsonBinding.fromJson(JsonBinding.java:93)
	at org.jboss.resteasy.plugins.providers.jsonb.JsonBindingProvider.readFrom(JsonBindingProvider.java:66)
	... 98 more
Caused by: java.lang.NullPointerException
	at java.util.Objects.requireNonNull(Objects.java:203)
	at org.eclipse.yasson.internal.ReflectionUtils.createNoArgConstructorInstance(ReflectionUtils.java:201)
	at org.eclipse.yasson.internal.serializer.ObjectDeserializer.getInstance(ObjectDeserializer.java:94)
	at org.eclipse.yasson.internal.serializer.AbstractContainerDeserializer.deserialize(AbstractContainerDeserializer.java:61)
	at org.eclipse.yasson.internal.Unmarshaller.deserializeItem(Unmarshaller.java:70)
	... 102 more

I would like to improve the Message of the Exception when a default constructor is missing.
I would put an additional null check into ObjectDeserializer#getInstance and throw an Exception when the constructor is not present containing the name of the class so a user knows the affected class and how to fix the issue.

As I said, I would like to provide a fix by myself in the following days.

@Simulant87
Copy link
Contributor Author

I closed the ticket, as the merge request containing the enhancement is merged.

@aguibert aguibert added this to the 1.0.5 milestone Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants