1 Reply Latest reply on May 17, 2016 6:04 AM by pjhavariotis

    Getting Started with JBoss EAP 6.4 and Hibernate Search - not working ?

    seniorteaboy

      I've followed the getting started guide for Hibernate Search,

       

      added the following properties to my persistence.xml

       

               <property name="hibernate.search.default.directory_provider" value="filesystem"/>

               <property name="hibernate.search.default.indexBase" value="/temp/lucene"/>

       

      added @Indexed and @Field annotations to some entities

       

      AND - written a few lines to initially create the index :

       

               final FullTextEntityManager fullTextEntityManager = Search.getFullTextEntityManager(em);

               final MassIndexer indexer = fullTextEntityManager.createIndexer();

               indexer.startAndWait();

       

       

      However -- when I attempt to run the above code to create the index - I still get the following exception :

       

      javax.ejb.EJBException: org.hibernate.HibernateException: Hibernate Search Event listeners not configured, please check the reference documentation and the application's hibernate.cfg.xml

       

      I can set the Event Listeners manually in the persistence.xml (although everything I've read seems to suggest I shouldn't need to) :

       

                  <property name="hibernate.ejb.event.post-insert" value="org.hibernate.search.event.impl.FullTextIndexEventListener"/>

                  <property name="hibernate.ejb.event.post-update" value="org.hibernate.search.event.impl.FullTextIndexEventListener"/>

                  <property name="hibernate.ejb.event.post-delete" value="org.hibernate.search.event.impl.FullTextIndexEventListener"/>

       

       

      But - then I just get a NullPointerException while trying to invoke : fullTextEntityManager.createIndexer();

       

                java.lang.NullPointerException

                org.hibernate.search.impl.FullTextSessionImpl.index(FullTextSessionImpl.java:199)

                org.hibernate.search.jpa.impl.FullTextEntityManagerImpl.index(FullTextEntityManagerImpl.java:112)

       


      does anyone know if there's a problem with getting Hibernate Search to work under EAP 6.4 ?