-->
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 in FullTextSessionImpl constructor
PostPosted: Sun Jul 29, 2007 11:15 pm 
Newbie

Joined: Sun Jul 29, 2007 1:40 am
Posts: 1
Hibernate version:

core 3.2.1 ga
annotations 3.3.0 ga
search: 3.0.0 Beta3

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

luceneQuery = parser.parse(...);
FullTextSession fullTextSession = Search.createFullTextSession(session);
Query fullTextQuery = fullTextSession.createFullTextQuery(luceneQuery, entityClass);

Full stack trace of any exception that occurs:

Caused by: java.lang.ClassCastException: $Session_1140fa833d0
at org.hibernate.search.impl.FullTextSessionImpl.<init>(FullTextSessionImpl.java:66)
at org.hibernate.search.Search.createFullTextSession(Search.java:17)
at model.impl.BaseManagerImpl.findEntities(BaseManagerImpl.java:48)
...
at $PropertyConduit_1140fa8341e.get($PropertyConduit_1140fa8341e.java)
at org.apache.tapestry.internal.bindings.PropBinding.get(PropBinding.java:54)

Name and version of the database you are using:

MySQL 5.0.27

Possible Explanation:

I'm using tapestry-hibernate 5.0.5. The Session is injected automatically. It is an instance of org.hibernate.Session. In org.hibernate.search.impl.FullTextSessionImpl, it tries to cast org.hibernate.Session to org.hibernate.classic.Session and thus ClassCastException results.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 30, 2007 4:00 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Yes Hibernate Search needs a Session object that implements:
- o.h.classic.Session
- o.h.event.EventSource
- o.h.engine.SessionImplementor
Those 3 are implemented by the SessionImpl object

so either tapestry has to provide an Hibernate Search integration, or a way for you to access the underlying session object (not the proxy).

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 30, 2007 4:00 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Yes Hibernate Search needs a Session object that implements:
- o.h.classic.Session
- o.h.event.EventSource
- o.h.engine.SessionImplementor
Those 3 are implemented by the SessionImpl object

so either tapestry has to provide an Hibernate Search integration, or a way for you to access the underlying session object (not a proxy).

_________________
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.