[hibernate-dev] Hibernate Search fails to generate anything
Martin Braun
martinbraun123 at aol.com
Tue Jul 7 04:26:15 EDT 2015
Hi,
sounds a lot like Hibernate Search is not properly started yet if the ExtendedSearchIntegrator
is equal to null.
Martin Braun
martinbraun123 at aol.com
www.github.com/s4ke
-----Original Message-----
From: Dmitry Bocharov <bdshadow at gmail.com>
To: Koen Aers <koen.aers at gmail.com>; hibernate-dev <hibernate-dev at lists.jboss.org>
Sent: Mon, Jul 6, 2015 3:30 pm
Subject: [hibernate-dev] Hibernate Search fails to generate anything
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