Hi Loïc,
This warning comes from the ReflectiveHierarchyStep which only works
with the CombinedIndexBuildItem which only considers the application
archive indexes. In other words, additional beans will not help here
(these are only added to the bean archive used by CDI). See
https://stackoverflow.com/a/55513723/2654154 for more info how to index
the dependency.
Martin
Dne 22. 07. 19 v 15:28 Loïc MATHIEU napsal(a):
> Hello,
>
> I'm struggle with the following error when creating my Panache Mongo
> extension :
> 15:11:13,696 WARN [io.qua.dep.ste.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
> 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.");.
>
> I try to register the ObjectId class in a lot of different way in the
> Deployment Processor but none solves the issue:
>
> @BuildStep
> AdditionalBeanBuildItemregisterAdditionalBeans(BuildProducer<AdditionalBeanBuildItem> beans) {
> beans.produce(AdditionalBeanBuildItem.unremovableOf(ObjectId.class));
>
> AdditionalBeanBuildItem.Builder builder = AdditionalBeanBuildItem.builder();
> builder.addBeanClass(ObjectId.class);
> return builder.build();
> }
>
> @BuildStep
> BeanDefiningAnnotationBuildItemregisterX() {
> return new BeanDefiningAnnotationBuildItem(DOTNAME_BSON_ID);
> }
>
> I'm sure I miss something somewhere ... ObjectId is used as a field from
> an class that is enhanced by the deployment processor so I thought that
> Jandex will knows it.
>
> Regards,
>
> Loïc
>
> --
> You received this message because you are subscribed to the Google
> Groups "Quarkus Development mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
quarkus-dev...@googlegroups.com
> <mailto:
quarkus-dev...@googlegroups.com>.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/quarkus-dev/CAJLxjVHEvzppK3gn5UysBhT%2BYw1W_n6RNYSFwFsRcTTLjX9xWw%40mail.gmail.com
> <
https://groups.google.com/d/msgid/quarkus-dev/CAJLxjVHEvzppK3gn5UysBhT%2BYw1W_n6RNYSFwFsRcTTLjX9xWw%40mail.gmail.com?utm_medium=email&utm_source=footer>.
--
Martin Kouba
Senior Software Engineer
Red Hat, Czech Republic