You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When building Quarkus application that using mongodb-client and mongodb-panache extentions, ReflectiveHierarchyStep grumbles:
[WARNING] [io.quarkus.deployment.steps.ReflectiveHierarchyStep] Unable to properly register the hierarchy of the following classes for reflection as they are not in the Jandex index:
- org.bson.types.ObjectId (source: <unknown>)
Consider adding them to the index either by creating a Jandex index for your dependency via the Maven plugin, an empty META-INF/beans.xml or quarkus.index-dependency properties.
To resolve issue already tried to add org.mongodb:bson to quarkus.index-dependency.
The problem here is that all classes within bson library is added to Jandex index, including all CodecProvider's. This causes MongoClientProcessor to register all internal codec providers again, and fail on many of this that does not have default no-arg constructor.
The better solution is to add BuildStep in mongodb-client extention, that should explicitly add only org.bson.types.* classes to Jandex index. I'll try to provide PR with fix for this issue.
The text was updated successfully, but these errors were encountered:
Thanks for reporting this one @afedotov , I'm aware of it since a long time, this is just an harmless warning, your application will works without any issue.
I agree this needs to be workedaround to avoid people asking themself if it's a rela issue or not.
Describe the bug
When building Quarkus application that using
mongodb-client
andmongodb-panache
extentions, ReflectiveHierarchyStep grumbles:To Reproduce
Create a sample application:
Add sample entity:
Add sample repository:
Build project and observe mentioned message:
Environment
Quarkus version or git rev
1.13.7.Final
, also tried build from main branch:Additional info
To resolve issue already tried to add
org.mongodb:bson
toquarkus.index-dependency
.The problem here is that all classes within bson library is added to Jandex index, including all CodecProvider's. This causes MongoClientProcessor to register all internal codec providers again, and fail on many of this that does not have default no-arg constructor.
The better solution is to add BuildStep in mongodb-client extention, that should explicitly add only org.bson.types.* classes to Jandex index. I'll try to provide PR with fix for this issue.
The text was updated successfully, but these errors were encountered: