[hibernate-dev] CDI / ORM / WildFly / Search integration plumbing
Sanne Grinovero
sanne at hibernate.org
Tue Aug 29 11:18:09 EDT 2017
Hi all,
In Hibernate Search we have a snippet of code doing:
private static BeanManager getBeanManager(Map<?, ?> configurationValues) {
return (BeanManager) configurationValues.get(
AvailableSettings.CDI_BEAN_MANAGER );
}
This used to work on WildFly 10 - even if we were to override the
Hibernate ORM version to 5.2.
By runnning the same integration test on WildFly 11 I'm now getting a
ClassCastException as the returned instance is of type
`org.jboss.as.jpa.hibernate5.HibernateExtendedBeanManager`, which does
implement `org.hibernate.jpa.event.spi.jpa.ExtendedBeanManager` but
does not implement the standard
`javax.enterprise.inject.spi.BeanManager` interface.
I'm unsure if this is a bug in the Search code or a misunderstanding
between the WildFly / ORM integration?
This javadoc seems relevant:
/**
* Used to pass along the CDI BeanManager, if any, to be used.
*/
String CDI_BEAN_MANAGER = "javax.persistence.bean.manager";
or should I interpret this property as meant only for "write" purposes
into the ORM configuration? I suppose it's unexpected that we attempt
to retrieve this as well.
Thanks,
Sanne
More information about the hibernate-dev
mailing list