[hibernate-dev] Hibernate Search fails to generate anything

Sanne Grinovero sanne at hibernate.org
Wed Jul 15 07:35:25 EDT 2015


Hi Koen,
this is a classloader issue for which we'll need your help. It's a
very simple issue: Hibernate ORM needs to see the services exposed
from Hibernate Search when the SessionFactory is started, so that it
triggers the correct integrations.

My guess is that some metadata needs to be changed in the Hibernate
ORM plugin to allow loading from the Search module. Is that something
you could help Dmitry with?

thanks,
Sanne


On 6 July 2015 at 14:29, Dmitry Bocharov <bdshadow at gmail.com> wrote:
> Hello, everyone!
> I'd like to discuss with you the problem. I'm writing a hibernate-search
> eclipse plugin and currently I have a problem with generating indexes.
> I try to generate indexes in HSearchServiceProxy class
> <https://github.com/Sanne/org.jboss.tools.hibernate.search/blob/master/hsearchplugins/org.jboss.tools.hibernate.search.runtime.v_4_5/src/org/jboss/tools/hibernate/search/HSearchServiceProxy.java>.
> The code runs till the end fine. I was able to debug it. However, nothing
> is created.
>
> I have a user project. In hibernate.cfg.xml there is:
>
> *  <property
> name="hibernate.search.default.directory_provider">filesystem</property>*
> *  <property
> name="hibernate.search.default.indexBase">D:\Spring\HibernateWS\gen_indexes</property>*
>
> Also there is
> *        <dependency>*
> *  <groupId>org.hibernate</groupId>*
> *  <artifactId>hibernate-search-orm</artifactId>*
> *  <version>5.0.1.Final</version>*
> *  </dependency>*
> in the *pom.xml* in order to annotate entities to index them:
>
> *@Entity*
> *@Indexed*
> *public class Person implements java.io.Serializable {*
> * @Id*
> * @GeneratedValue*
> * private int id;*
> * @Field(analyze=Analyze.YES, store=Store.NO)*
> * private String login;*
>
> When i try to create indexes as a user - it works fine. However, when I try
> to do it from my plugin nothing happens. I debugged and found that the call
> stack is the following: MassIndexerImpl.startAndWait() ->
> FullTextSessionImpl.getSearchIntegrator() ->
> ContextHelper.getSearchintegratorBySFI(SessionFactoryImplementor sfi) ->
> SearchFactoryReference.getSearchIntegrator(). And here
> <https://github.com/hibernate/hibernate-search/blob/c06e4fe5fbc6b5a09195f40d760a093691f2c7f2/orm/src/main/java/org/hibernate/search/hcore/impl/SearchFactoryReference.java>
> it
> creates and exception in getSearchIntegrator() because
> this.extendedIntegrator returns null.
>
> As I understand plugin classloader is different from user classloader. So
> that can be a problem. In my plugin I have hibernate-core 4.3.1 (from
> jbosstolls-hibernate) and hibernate-search (5.0.1 as a fragment of this
> jbosstolls-hibernate plugin) in the classpath. I found that versions are
> compatible, so it's not a problem.
>
> So the only problem, as I think, are different classloaders.
>
> Koen Aers and Sanne Grinovero are in touch with the problem. So If anyone
> else has any thoughts, it would be great to see =)
>
> Thanks in advance!
> Dmitry
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev


More information about the hibernate-dev mailing list