Hello,
I am currently trying to get Hibernate Search running in my WAR app. In order to create the index I have the following method:
Code:
@Transactional
public void createIndex()
{
log.info("creating index") ;
FullTextEntityManager ftem = Search.getFullTextEntityManager(entityManager);
try
{
// fullTextEntityManager.createIndexer().startAndWait() ;
ftem.createIndexer().startAndWait() ;
}
catch(InterruptedException e)
{
log.info("interrupted exception" + e) ;
}
}
However this makes the server cough with the following error when it gets to the line involving the FullTextEntityManager:
Code:
java.lang.ClassCastException: org.jboss.seam.persistence.HibernateSessionProxy cannot be cast to org.hibernate.classic.Session
at org.hibernate.search.impl.FullTextSessionImpl.<init>(FullTextSessionImpl.java:102)
at org.hibernate.search.Search.getFullTextSession(Search.java:46)
at org.hibernate.search.jpa.impl.FullTextEntityManagerImpl.getFullTextSession(FullTextEntityManagerImpl.java:69)
at org.hibernate.search.jpa.impl.FullTextEntityManagerImpl.createIndexer(FullTextEntityManagerImpl.java:290)
at com.maierinc.stylect.session.RecordConversationAction.createIndex(RecordConversationAction.java:96)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
etc...
I've tried on both Jboss 4.2.3 (with hibernate libraries updated) and JBoss 5.0.1. Same issue. A short blog stated that it's libraries conflict but didn't state what precise combination of libraries had worked for them.
Google didn't give up any secrets. I'm at a loss. Help would be greatly appreciated.
Thank you,
Dahn