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

Replace reflect-config.json with @Reflected in examples #2183

Closed
tomas-langer opened this issue Jul 17, 2020 · 5 comments
Closed

Replace reflect-config.json with @Reflected in examples #2183

tomas-langer opened this issue Jul 17, 2020 · 5 comments

Comments

@tomas-langer
Copy link
Member

We now have a @Reflected annotation to register a class for reflection in native image (when it must be reflected for all constructors and methods).

We should use reflect-config.json for third party classes and for classes where we want to enable only a small subset of its signature.

@tomas-langer
Copy link
Member Author

Once #3358 is merged, we may not need this at all

@klustria
Copy link
Member

When removing reflect-config.json, I'm getting this error:

Caused by: javax.json.bind.JsonbException: Cannot create instance of a class: class io.helidon.examples.dbclient.common.Pokemon, No default constructor found.
        at org.eclipse.yasson.internal.serializer.ObjectDeserializer.getInstance(ObjectDeserializer.java:101)
        at org.eclipse.yasson.internal.serializer.AbstractContainerDeserializer.deserialize(AbstractContainerDeserializer.java:65)
        at org.eclipse.yasson.internal.Unmarshaller.deserializeItem(Unmarshaller.java:62)
        at org.eclipse.yasson.internal.Unmarshaller.deserialize(Unmarshaller.java:51)
        at org.eclipse.yasson.internal.JsonBinding.deserialize(JsonBinding.java:59)
        at org.eclipse.yasson.internal.JsonBinding.fromJson(JsonBinding.java:99)
        at io.helidon.media.jsonb.JsonbBodyReader$BytesToObject.map(JsonbBodyReader.java:83)
        at io.helidon.media.jsonb.JsonbBodyReader$BytesToObject.map(JsonbBodyReader.java:70)
        at io.helidon.common.mapper.Mapper.apply(Mapper.java:39)
        at io.helidon.common.reactive.MultiMapperPublisher$MapperSubscriber.onNext(MultiMapperPublisher.java:73)
        ... 42 more

Adding @Reflected resolves this issue.

@klustria
Copy link
Member

Tested against MongoDB... will further test with Oracle DB and MySQL

@klustria
Copy link
Member

The tests worked for both MongoDB and Oracle DB. Failed with MySQL but readme mentions that MySQL is not supported for GraalVm native image. Creating a PR for review.

@klustria
Copy link
Member

Implemented via #3576

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

No branches or pull requests

3 participants