-->
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.  [ 8 posts ] 
Author Message
 Post subject: Hibernate Search event listener onPostInsert
PostPosted: Thu May 03, 2007 9:25 am 
Newbie

Joined: Thu May 03, 2007 9:10 am
Posts: 4
Hi all!

I'm trying to integrate Hibernate Search, and when adding the event listeners in the config file, it throws:

[INFO] (class: org/hibernate/search/event/FullTextIndexEventListener, method: on
PostInsert signature: (Lorg/hibernate/event/PostInsertEvent;)V) Incompatible arg
ument to function
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.VerifyError: (class: org/hibernate/search/event/FullTextIndexEventList
ener, method: onPostInsert signature: (Lorg/hibernate/event/PostInsertEvent;)V)
Incompatible argument to function
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
....etc

I've been reading other posts, in which recommended update versions of hibernate-core, annotations, etc.

I'm using hibernate 3.2.3.ga; annotations 3.3.0.ga; search 3.0.0.Beta1.

Any idea?


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 03, 2007 9:56 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Double check your classpath, usually it means you forgot an old hibernate-annptations.jar or hibernate3.jar in your classpath

_________________
Emmanuel


Top
 Profile  
 
 Post subject: Hibernate Search event listener onPostInsert
PostPosted: Thu May 03, 2007 10:14 am 
Newbie

Joined: Thu May 03, 2007 9:10 am
Posts: 4
Uhmm I've checked the classpath and I don't have old references :s
I've also checked the signatures of the methods that seem broken, and are OK too...


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 03, 2007 10:57 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
The problem is that I use the same claimed combination as you do and it works fine, inside and outside the app server, So I don't know what to tell you :-(

_________________
Emmanuel


Top
 Profile  
 
 Post subject: Hibernate Search event listener onPostInsert
PostPosted: Thu May 03, 2007 11:14 am 
Newbie

Joined: Thu May 03, 2007 9:10 am
Posts: 4
The thing is I do have hibernate-annotations because for eg. AccessType needs it. Besides, it's only when I try to register the event listeners. If I take out those lines from the hibernate conf, everything's alright.

I send u here the class I am persisting and pretending to index...

@Entity
@AccessType("field")
@Table(name = "userfile")
@Indexed(index="indexes/userfile")
public abstract class UserFile {

/* ATTRIBUTES */

/**
* Unique ID for each file in the system.
*/
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@DocumentId
private long id;

/**
* Logical name for the file, it must be unique within the group
* of files of the same type for a given user.
*/
@Column (length = 100)
@Field(index=Index.TOKENIZED, store=Store.YES)
private String name;

/**
* Short file description.
*/
@Column (length = 200)
@Field(index=Index.TOKENIZED, store=Store.YES)
private String description;

etc.....

and the hibernate configuration:

...
<property name="hibernate.search.default.directory_provider">
org.hibernate.search.store.FSDirectoryProvider
</property>

<property name="hibernate.search.default.indexBase">
C:\lucene\indexes
</property>

....mappings....

<event type="post-update">
<listener
class="org.hibernate.search.event.FullTextIndexEventListener" />
</event>
<event type="post-insert">
<listener
class="org.hibernate.search.event.FullTextIndexEventListener" />
</event>
<event type="post-delete">
<listener
class="org.hibernate.search.event.FullTextIndexEventListener" />
</event>
</session-factory>

</hibernate-configuration>


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 03, 2007 2:45 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Are you using Hibernate Annotations (ie AnnotationConfiguration) to build your session factory?
If so, you should not even have to register the events, check the Hibernate Annotations version number in the logs (INFO level), you can also check the Hibernate Core version number too to be safe

_________________
Emmanuel


Top
 Profile  
 
 Post subject: Lucene event listener not initialized
PostPosted: Mon May 07, 2007 11:13 am 
Newbie

Joined: Thu May 03, 2007 9:10 am
Posts: 4
I removed the event listeners mapping, and checked my versions:

INFO [ Version.java:15 ] - Hibernate Annotations 3.2.1.GA
INFO [ Environment.java:509 ] - Hibernate 3.2.3

I've developed my controller and services using Spring, and when testing the following is logged:

org.hibernate.HibernateException: Lucene event listener not initialized
at org.hibernate.search.util.ContextHelper.getLuceneEventListener(ContextHelper.java:24)
at org.hibernate.search.query.FullTextQueryImpl.list(FullTextQueryImpl.java:137)

Any idea?


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 07, 2007 11:31 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
if you use the latest Search version, you have to use Hibernate Annotations 3.3.x (check the compatibility matric in the download page of www.hibernate.org

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 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.