-->
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.  [ 3 posts ] 
Author Message
 Post subject: ClassCastException within Hibernate.search (lucene) module
PostPosted: Thu Dec 21, 2006 4:54 am 
Beginner
Beginner

Joined: Mon Jul 05, 2004 9:29 am
Posts: 38
Hibernate version:

core 3.2.1.ga
annotations 3.2.1.ga

Code between sessionFactory.openSession() and session.close():

Session session = sessionFactory.getCurrentSession();
FullTextSession fullTextSession = Search.createFullTextSession(session);

Full stack trace of any exception that occurs:

Exception in thread "main" java.lang.ClassCastException: $Proxy21
at org.hibernate.search.impl.FullTextSessionImpl.<init>(FullTextSessionImpl.java:54)
at org.hibernate.search.Search.createFullTextSession(Search.java:17)
at com.mycompany.myproject.SearchTest.test(SearchTest.java:137)

Possible explanation

Apparently, creating a FullTextSession with a session obtained via SessionFactory.getCurrentSession() configured to work with a ThreadLocal (hibernate.current_session_context_class = thread) causes a ClassCastException. The ThreadLocalSessionContext proxies the session that cannot later be casted into a SessionImpl in the FullTextSessionImpl constructor.

Should I report to JIRA ?

regards,
Xavier


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 01, 2007 6:41 am 
Newbie

Joined: Fri Feb 10, 2006 6:02 am
Posts: 15
I've created the following bug in JIRA
http://opensource.atlassian.com/project ... se/ANN-568

Also, this may be of interest also...
http://jira.jboss.com/jira/browse/EJBTHREE-714


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 01, 2007 2:03 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Arg, sorry guys for the huge delay. I barely monitor the Users forum, you'd better use the Java Persistence forum for Search questions http://forum.hibernate.org/viewforum.php?f=9

I did fix the bug on my side (ie the ThreadLocalSession bug), And I am pusing to get JBoss EJB 3 fixed for the next release too.

_________________
Emmanuel


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