mathpere / grails-hibernate-search-plugin

Integrates Hibernate Search features to Grails
http://grails.org/plugin/hibernate-search
Apache License 2.0
21 stars 18 forks source link

NoSuchMethodError - search().list doesn't seem to exist on domain object #35

Closed cbmarcum closed 6 years ago

cbmarcum commented 6 years ago

NoSuchMethodError Caused by org.hibernate.engine.spi.SessionDelegatorBaseImpl.(Lorg/hibernate/engine/spi/SessionImplementor;)V

Could be something I'm missing.

I have create a simple sample here: https://github.com/cbmarcum/hibernate-search-single-app ran with ./gradlew clean bootRun

Most of stacktrace.. Grails application running at http://localhost:8080 in environment: development 2017-09-24 15:50:46.005 ERROR --- [nio-8080-exec-1] o.g.web.errors.GrailsExceptionResolver : NoSuchMethodError occurred when processing request: [GET] /book/index org.hibernate.engine.spi.SessionDelegatorBaseImpl.(Lorg/hibernate/engine/spi/SessionImplementor;)V. Stacktrace follows:

java.lang.reflect.InvocationTargetException: null at org.grails.core.DefaultGrailsControllerClass$ReflectionInvoker.invoke(DefaultGrailsControllerClass.java:211) at org.grails.core.DefaultGrailsControllerClass.invoke(DefaultGrailsControllerClass.java:188) at org.grails.web.mapping.mvc.UrlMappingsInfoHandlerAdapter.handle(UrlMappingsInfoHandlerAdapter.groovy:90) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) at org.springframework.boot.web.filter.ApplicationContextHeaderFilter.doFilterInternal(ApplicationContextHeaderFilter.java:55) at org.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:77) at org.grails.web.filters.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:67) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.NoSuchMethodError: org.hibernate.engine.spi.SessionDelegatorBaseImpl.(Lorg/hibernate/engine/spi/SessionImplementor;)V at org.hibernate.search.impl.FullTextSessionImpl.(FullTextSessionImpl.java:59) at org.hibernate.search.impl.ImplementationFactory.createFullTextSession(ImplementationFactory.java:34) at org.hibernate.search.Search.getFullTextSession(Search.java:44) at grails.plugins.hibernate.search.HibernateSearchApi.(HibernateSearchApi.groovy:278) at grails.plugins.hibernate.search.HibernateSearchApi.(HibernateSearchApi.groovy:285) at grails.plugins.hibernate.search.HibernateSearchGrailsPlugin$_doWithApplicationContext_closure2$_closure3.doCall(HibernateSearchGrailsPlugin.groovy:73) at myapp.BookController.index(BookController.groovy:23) at grails.transaction.GrailsTransactionTemplate$2.doInTransaction(GrailsTransactionTemplate.groovy:96) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) at grails.transaction.GrailsTransactionTemplate.execute(GrailsTransactionTemplate.groovy:93) ... 14 common frames omitted

Maybe you can see what I may have missed.

Thanks, Carl

lgrignon commented 6 years ago

I would say that it is basically a version discrepancy between Hibernate and Hibernate Search. I definitely recommend you to start from the quick start project I provide so you could use the same versions, otherwise you could just compare and fix dependencies' versions. I noticed many differences, I think you could start from here: https://github.com/cbmarcum/hibernate-search-single-app/blob/master/build.gradle https://github.com/lgrignon/grails3-quick-start/blob/master/build.gradle

https://github.com/cbmarcum/hibernate-search-single-app/blob/master/gradle.properties https://github.com/lgrignon/grails3-quick-start/blob/master/gradle.properties

cbmarcum commented 6 years ago

I made changes to gorm and hibernate version and my sample starts and runs. I'm getting a type mismatch: title was indexed with multiple values per document error but I'll work on that. Thanks for your help on this. Carl