Uploaded image for project: 'Hibernate ORM'
  1. HHH-12912

NullPointerException when named query with a converter is compiled before CDI BeanManager is available using WildFly

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: hibernate-core
    • Labels:
      None
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true
    • Sprint:

      Description

      WildFly builds EntityManagerFactory, before CDI BeanManager is available.

      While EntityManagerFactory is being built, a named query that uses a converter will result in org.hibernate.metamodel.model.convert.internal.JpaAttributeConverterImpl#toRelationalValue attempting to use CDI BeanManager (before CDI BeanManager is available), which results in the NPE.

      After EntityManagerFactory is built, and, later, when CDI BeanManager is available,
      org.hibernate.resource.beans.container.spi.ExtendedBeanManager$LifecycleListener#beanManagerInitialized is called. Only after that happens, is it safe for Hibernate to compile the named query that uses a converter.

        Attachments

          Activity

            People

            • Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated: