[hibernate-dev] Hibernate Search fails to generate anything

Dmitry Bocharov bdshadow at gmail.com
Mon Jul 6 09:29:28 EDT 2015


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


More information about the hibernate-dev mailing list