Hibernate 5 Search with Grails 3

Tobi

I am using Grails 3.1.4 and I want use Hibernate-Search for full text search of my entities.

In my build.gradle I have included Hibernate 5 and Hibernate Search

compile "org.hibernate:hibernate-core:5.0.9.Final"
compile "org.hibernate:hibernate-ehcache:5.0.9.Final"
compile "org.hibernate:hibernate-search-orm"

If I add the @Indexed to one of my domain classes, I get the folling error:

ERROR org.springframework.boot.SpringApplication - Application startup failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is java.lang.NullPointerException
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
    at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:207)
    at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:687)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:523)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766)
    at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
    at grails.boot.GrailsApp.run(GrailsApp.groovy:55)
    at grails.boot.GrailsApp.run(GrailsApp.groovy:365)
    at grails.boot.GrailsApp.run(GrailsApp.groovy:354)
    at grails.boot.GrailsApp$run.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
    at com.myapp.Application.main(Application.groovy:8)

Is there a way to get Hibernate Search working together with Grails domain classes?

Louis GRIGNON

as a coincidence, I am currently porting the old Grails 2 Hibernate Search plugin to be compatible with Grails 3.1.x and Hibernate 5. The original author is up to merge my PR as soon as I create it. I just finished the development if you want to give it a try:

https://github.com/lgrignon/grails-hibernate-search-plugin

EDIT:

The PR is merged, I just published in on bintray, which is the new Grails 3 platform for plugins distribution. To try the new version of Grails Hibernate Search 2.0 for Grails 3.1.x / GORM 5: Add the following repository maven { url "http://idcapture.bintray.com/plugins" }

And add the following to your dependencies compile("org.grails.plugins:hibernate-search:2.0")

it should work :)

Hope it helps!

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

MappingException when migrating from Hibernate 3 / Grails 2.2.4 to Hiberate 5 / Grails 3.2.4

From Dev

How to configure Grails 3.1.1 to use Hibernate 5

From Dev

Access Directory in Hibernate Search 5

From Dev

Grails - hibernate upgrade from 3 to 4

From Dev

Grails : how to best construct a hibernate criteria builder to search 'hasMany' relationships with domain instance

From Dev

Grails with MongoDB and Hibernate

From Dev

Configuring Hibernate with grails

From Dev

Hibernate Envers in Grails

From Dev

Grails hibernate dialect

From Dev

Grails/Hibernate Cache unpredictable

From Dev

Migrating Hibernate 3 to 5: relation hibernate_sequence does not exist

From Dev

Migration from Hibernate 3 to Hibernate 5: sessionFactory (MetadataImplementor) is null

From Dev

Problems with dialect SQLite 3 with Hibernate 5

From Dev

grails search with where on a hasmany

From Dev

AJAX search in grails

From Dev

Grails 3 integration tests throw "No Session found for current thread" hibernate exception when saving entities

From Dev

How to use Hibernate Spatial in Grails?

From Dev

Hibernate JPA conflict in Grails 2.4.4

From Dev

Mapping with Hibernate Annotations in Grails 3.0.1

From Dev

How to use Hibernate Spatial in Grails?

From Dev

Grails-generated Hibernate Definitions

From Dev

Hibernate Search spatial facet query works first 5 times then only returns the 5th result

From Dev

Search in database for text (with Hibernate Search)

From Dev

Grails: Search with inheritance in domain class

From Dev

Grails search function/solution needed

From Dev

Grails / GORM withCriteria search toString()

From Dev

Spring Boot 2.0 Hibernate 5 EhCache 3 with JCache

From Dev

Hibernate Search query for class

From Dev

Hibernate search on prefixes

Related Related

  1. 1

    MappingException when migrating from Hibernate 3 / Grails 2.2.4 to Hiberate 5 / Grails 3.2.4

  2. 2

    How to configure Grails 3.1.1 to use Hibernate 5

  3. 3

    Access Directory in Hibernate Search 5

  4. 4

    Grails - hibernate upgrade from 3 to 4

  5. 5

    Grails : how to best construct a hibernate criteria builder to search 'hasMany' relationships with domain instance

  6. 6

    Grails with MongoDB and Hibernate

  7. 7

    Configuring Hibernate with grails

  8. 8

    Hibernate Envers in Grails

  9. 9

    Grails hibernate dialect

  10. 10

    Grails/Hibernate Cache unpredictable

  11. 11

    Migrating Hibernate 3 to 5: relation hibernate_sequence does not exist

  12. 12

    Migration from Hibernate 3 to Hibernate 5: sessionFactory (MetadataImplementor) is null

  13. 13

    Problems with dialect SQLite 3 with Hibernate 5

  14. 14

    grails search with where on a hasmany

  15. 15

    AJAX search in grails

  16. 16

    Grails 3 integration tests throw "No Session found for current thread" hibernate exception when saving entities

  17. 17

    How to use Hibernate Spatial in Grails?

  18. 18

    Hibernate JPA conflict in Grails 2.4.4

  19. 19

    Mapping with Hibernate Annotations in Grails 3.0.1

  20. 20

    How to use Hibernate Spatial in Grails?

  21. 21

    Grails-generated Hibernate Definitions

  22. 22

    Hibernate Search spatial facet query works first 5 times then only returns the 5th result

  23. 23

    Search in database for text (with Hibernate Search)

  24. 24

    Grails: Search with inheritance in domain class

  25. 25

    Grails search function/solution needed

  26. 26

    Grails / GORM withCriteria search toString()

  27. 27

    Spring Boot 2.0 Hibernate 5 EhCache 3 with JCache

  28. 28

    Hibernate Search query for class

  29. 29

    Hibernate search on prefixes

HotTag

Archive