-->
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: ClassCastException while using FullTextIndexEventListener
PostPosted: Thu Nov 26, 2009 8:54 am 
Regular
Regular

Joined: Thu Nov 26, 2009 8:45 am
Posts: 78
Hi,
I'm tryin to setup Hibernate Search, but currently i don't get it.

i use:

Hibernate 3.2.6.
Hibernate Search 3.0.1.
Hibernate Commons Annotations 3.0.0.

i added the following to my hibernate.cfg.xml:
Code:
<property name="hibernate.search.default.directory_provider">org.hibernate.search.store.FSDirectoryProvider</property>
<property name="hibernate.search.default.indexBase">../indexes</property>
<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>


while starting up my application i get the following exception:
Code:
org.hibernate.cfg.Configuration: java.lang.ClassCastException: org.hibernate.cfg.Configuration
   at org.hibernate.search.event.FullTextIndexEventListener.initialize(FullTextIndexEventListener.java:82)
   at org.hibernate.event.EventListeners.initializeListeners(EventListeners.java:417)
   at org.hibernate.cfg.Configuration.getInitializedEventListeners(Configuration.java:1310)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1300)


i didnt use the annotations (except for the search-ones of course), instead i use hbm.xml files.

Could somebody tell me what i am missing or doing wrong here?

[edit: recognized it was the wrong versions, i updated them, but problem still stays the same]

thx in advance,

hage


Top
 Profile  
 
 Post subject: Re: ClassCastException while using FullTextIndexEventListener
PostPosted: Thu Nov 26, 2009 12:03 pm 
Newbie

Joined: Thu Nov 26, 2009 11:24 am
Posts: 2
I am facing exactly the same problem today. If you find something, post a message. thx


Top
 Profile  
 
 Post subject: Re: ClassCastException while using FullTextIndexEventListener
PostPosted: Thu Nov 26, 2009 6:52 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Quote:
org.hibernate.cfg.Configuration: java.lang.ClassCastException: org.hibernate.cfg.Configuration

this means you're having duplicates of hibernate core .jar on classpath.
Are you deploying on JBoss? hibernate-core is included in commons lib, don't include it in you war too!

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


Top
 Profile  
 
 Post subject: Re: ClassCastException while using FullTextIndexEventListener
PostPosted: Fri Nov 27, 2009 10:48 am 
Newbie

Joined: Thu Nov 26, 2009 11:24 am
Posts: 2
You were right, in my eclipse one bad hibernate3.jar was still present. Thank you for your help!


Top
 Profile  
 
 Post subject: Re: ClassCastException while using FullTextIndexEventListener
PostPosted: Wed Dec 02, 2009 8:16 am 
Regular
Regular

Joined: Thu Nov 26, 2009 8:45 am
Posts: 78
Thats the solution to my problem. Thx a lot. I'm not deploying on JBoss, but i do have a jbossclient in my classpath, which itself contains its own hibernate, which was the root of the problem.


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.