-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Hibernate Search works?
PostPosted: Thu Dec 06, 2007 8:32 am 
Newbie

Joined: Wed Aug 29, 2007 2:09 pm
Posts: 6
I put in my persistence.xml:

Code:
<property name="hibernate.search.default.directory_provider"
                      value="org.hibernate.search.store.FSDirectoryProvider"/>           
<property name="hibernate.search.default.indexBase"
                      value="C:\temp\indexes"/>         
           
<property name="hibernate.ejb.event.post-insert" value="org.hibernate.search.event.FullTextIndexEventListener"/>
<property name="hibernate.ejb.event.post-update" value="org.hibernate.search.event.FullTextIndexEventListener"/>
<property name="hibernate.ejb.event.post-delete" value="org.hibernate.search.event.FullTextIndexEventListener"/>


On class:
Code:
@Entity
@Indexed
public class License {

    @Id
    @DocumentId
    @GeneratedValue(strategy = GenerationType.AUTO)
    @NotNull
    private Long id;

    @NotNull
    @Length(min = 3, max = 30)
    @Field(index=TOKENIZED, store=YES)
    private String sufix;
   
    ...

}


I put the Hibernate-Search 3.0.0, Lucene-core 2.20 and Hibernate-common-annotation 3.0.0.
I'm using Jboss 4.2.2 then when the project deploys it show that is using Hibernate EntityManager 3.2.1, Hibernate Annotations 3.2.1 and Hibernate 3.2.4.sp1.

but On updates or inserts the follow error appear:

Code:
Caused by: java.lang.NoSuchMethodError: org.apache.lucene.document.Document.add(Lorg/apache/lucene/d
ocument/Field;)V
at org.hibernate.search.engine.DocumentBuilder.getDocument(DocumentBuilder.java:234)
at org.hibernate.search.event.FullTextIndexEventListener.onPostUpdate(FullTextIndexEventList
ener.java:165)
at org.hibernate.action.EntityUpdateAction.postUpdate(EntityUpdateAction.java:180)


If I remove the:

Code:
<property name="hibernate.ejb.event.post-insert" value="org.hibernate.search.event.FullTextIndexEventListener"/>
<property name="hibernate.ejb.event.post-update" value="org.hibernate.search.event.FullTextIndexEventListener"/>
<property name="hibernate.ejb.event.post-delete" value="org.hibernate.search.event.FullTextIndexEventListener"/>


I insert and update records nothing happens!

After I try this:

Code:
FullTextEntityManager entityManager;

...

List<License> ls = licenses.getResultList();
       
for (License license : ls) {
           
    entityManager.index(license);
           
}


the exception appears:

Code:
Caused by: org.hibernate.HibernateException: Lucene event listener not initialized


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 16, 2008 11:50 am 
Newbie

Joined: Fri May 16, 2008 11:48 am
Posts: 3
I've got the same problem. How is it possible to solve it?


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 16, 2008 12:01 pm 
Newbie

Joined: Fri May 16, 2008 11:48 am
Posts: 3
I suppose that it could be the problem of version conflict, but what exactly I can't understand.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 16, 2008 1:01 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
you should keep the three lines in the XML, they are required for your hibernate version.
You should upgrade your Lucene jar, I guess to 2.3.0 (where did you get version 2.2?).

The XML code is no longer required if you use all latest hibernate jars, that means that you could download all latest (stable) versions and replace the ones in your project and in the jboss lib directory.

regards,

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 03, 2008 4:53 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
There have been a few posts on the subject, you need to update the versiosn of hibernat-*.jar in JBoss AS.

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.