java.lang.ClassCastException: org.hibernate.search.mapper.orm.bootstrap.impl.ExtendedBeanManagerSynchronizer cannot be cast to org.hibernate.jpa.event.spi.jpa.ExtendedBeanManager$LifecycleListener
Description
Activity

al turkerOctober 21, 2021 at 11:09 AM
I will try it. Thanks.

Yoann RodièreOctober 21, 2021 at 9:51 AM
This part of the stack trace clearly points to Hibernate ORM 5.3:
at org.hibernate.jpa.event.spi.jpa.ExtendedBeanManager.registerLifecycleListener(ExtendedBeanManager.java:18)
This line does not contain any code in Hibernate ORM 5.4.32:
But it does contain a cast in Hibernate ORM 5.3:
My bet would be that you bundled Hibernate ORM with your application, but EAP is still using Hibernate ORM 5.3 somehow. Make sure you upgrade Hibernate ORM correctly, as documented here, or reach out to support if that documentation doesn’t apply in your case.
Upgrading Hibernate ORM in WildFly/EAP is not as simple as bundling the Hibernate ORM library with your application.
See also this similar problem (not the same, though): https://discourse.hibernate.org/t/hsearch000501-cannot-add-custom-analyzer-to-perstience-xml/5682/4?u=yrodiere

al turkerOctober 21, 2021 at 9:20 AM
No, I used Hibernate ORM 5.4.32.Final in my project.

Yoann RodièreOctober 21, 2021 at 6:52 AM
I'll close this ticket, since this is a problem with JBoss EAP, not with Hibernate Search. I mentioned some pointers to solve this problem in my previous comment.
If you want more help, please open a ticket to Red Hat support.
If you can't, try getting support from [the WildFly community|https://groups.google.com/g/wildfly). If you encounter problems that are clearly related to Hibernate and not WildFly/EAP, try getting support from the Hibernate community.

Yoann RodièreOctober 21, 2021 at 6:47 AM
You seem affected by , which was fixed in Hibernate ORM 5.4.2.Final.
Because of that fix, and other incompatibilities, Hibernate Search 6 is only compatible with Hibernate ORM 5.4.4.Final or later (see ).
Red Hat JBoss EAP ships with Hibernate ORM 5.3.x, so it cannot work with Hibernate Search 6 without modifications.
You will need to upgrade to a more recent, community version of Hibernate ORM. Only Hibernate ORM 5.4 has a chance to work correctly with both Red Hat JBoss EAP and Hibernate Search, and I think Red Hat support around Hibernate ORM will be limited to best-effort if you do that, because there were a few significant changes in Hibernate ORM 5.4. You may want to request help from Red Hat support.
If you want to see Hibernate Search 6 supported in EAP, I would suggest making your interest known to Red Hat support, so that future versions of EAP are upgraded and provide Hibernate Search 6 out-of-the-box.
Details
Assignee
Yoann RodièreYoann RodièreReporter
al turkeral turkerAffects versions
Priority
Critical
Details
Details
Assignee

Reporter

Hi,
I tried to add Hibernate Search 6.0.7.Final to my ejb project running on JBOSS EAP 7.3/7.4. When I start the server, I got the following error. I am not sure if hibernate search conflicts with JBOSS 7.3/7.4 or other libraries.
Hope your help.
Thanks,
Al
11:40:25,175 [] ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool – 84) MSC000001: Failed to start service jboss.persistenceunit."LibraryAccessService-2.0.0-SNAPSHOT.ear/LibraryAccessService-ejb.jar#primary": org.jboss.msc.service.StartException in service jboss.persistenceunit."LibraryAccessService-2.0.0-SNAPSHOT.ear/LibraryAccessService-ejb.jar#primary": javax.persistence.PersistenceException: [PersistenceUnit: primary] Unable to build Hibernate SessionFactory
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:198)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:128)
at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:658)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:212)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
at java.lang.Thread.run(Thread.java:748)
at org.jboss.threads.JBossThread.run(JBossThread.java:485)
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: primary] Unable to build Hibernate SessionFactory
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:1016)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:942)
at org.jboss.as.jpa.hibernate5.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:170)
... 9 more
Caused by: java.lang.ClassCastException: org.hibernate.search.mapper.orm.bootstrap.impl.ExtendedBeanManagerSynchronizer cannot be cast to org.hibernate.jpa.event.spi.jpa.ExtendedBeanManager$LifecycleListener
at org.hibernate.jpa.event.spi.jpa.ExtendedBeanManager.registerLifecycleListener(ExtendedBeanManager.java:18)
at org.hibernate.search.mapper.orm.bootstrap.impl.HibernateOrmIntegrationBooterImpl.<init>(HibernateOrmIntegrationBooterImpl.java:104)
at org.hibernate.search.mapper.orm.bootstrap.impl.HibernateOrmIntegrationBooterImpl.<init>(HibernateOrmIntegrationBooterImpl.java:53)
at org.hibernate.search.mapper.orm.bootstrap.impl.HibernateOrmIntegrationBooterImpl$BuilderImpl.build(HibernateOrmIntegrationBooterImpl.java:368)
at org.hibernate.search.mapper.orm.bootstrap.impl.HibernateSearchIntegrator.integrate(HibernateSearchIntegrator.java:82)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:276)
at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:467)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:939)
... 11 more