[hibernate-dev] Hibernate Search fails to generate anything

Koen Aers koen.aers at gmail.com
Fri Jul 17 11:36:08 EDT 2015


Hey Sanne and Dmitry,

I am trying to wrap my head around this problem and I found that Hibernate ORM can see the Hibernate Search services. “SearchFactoryReference” is instantiated while building the services. However, its “initialize” method is never called. AFAICS this is the responsibility of “HibernateSearchSessionFactoryObserver”. I will look further into it but feel free to give pointers if you know any.

Cheers,
Koen



> Op 15-jul.-2015, om 13:35 heeft Sanne Grinovero <sanne at hibernate.org> het volgende geschreven:
> 
> 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 <mailto: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 <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 <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 <mailto:hibernate-dev at lists.jboss.org>
>> https://lists.jboss.org/mailman/listinfo/hibernate-dev <https://lists.jboss.org/mailman/listinfo/hibernate-dev>


More information about the hibernate-dev mailing list