-->
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.  [ 4 posts ] 
Author Message
 Post subject: Seam 2.2.0.GA + Hibernate Search ClassCastException.
PostPosted: Wed May 05, 2010 7:24 pm 
Newbie

Joined: Wed May 05, 2010 7:11 pm
Posts: 2
Hi folks: Using 2.2.0.GA + JBoss 4.2.3 + whatever version of hibernate-search is packaged in seam 2.2.0.GA

---------------------------

In my indexing bean:
Code:
@Name("indexerService")
@Scope(ScopeType.APPLICATION)
@Startup
public class IndexerService {
    private FullTextEntityManager entityManager;

    @In
    public void setEntityManager(FullTextEntityManager entityManager) {
        this.entityManager = entityManager;
    }

    @Create
    @Transactional
    public void index() {
        entityManager.purgeAll(Quote.class);
        List quotes = entityManager.createQuery("select quote from Quote as quote").getResultList();
        for (Object be : quotes) {
            entityManager.index(be);
        }
    }

    @Remove
    @Destroy
    public void stop() {
    }
}


I get the following exception:
Code:
Caused by: 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:74)
   at org.hibernate.search.Search.getFullTextSession(Search.java:23)
   at org.hibernate.search.jpa.impl.FullTextEntityManagerImpl.getFullTextSession(FullTextEntityManagerImpl.java:39)
   at org.hibernate.search.jpa.impl.FullTextEntityManagerImpl.purgeAll(FullTextEntityManagerImpl.java:85)
   at org.jboss.seam.persistence.FullTextEntityManagerProxy.purgeAll(FullTextEntityManagerProxy.java:55)
   at com.datacell.framework.IndexerService.index(IndexerService.java:34)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
   at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
   at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
   at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
   at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:97)
   at org.jboss.seam.util.Work.workInTransaction(Work.java:47)
   at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:91)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
   at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
   at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
   at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
   at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
   at com.datacell.framework.IndexerService_$$_javassist_seam_1.index(IndexerService_$$_javassist_seam_1.java)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
   at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
   at org.jboss.seam.Component.callComponentMethod(Component.java:2249)
   at org.jboss.seam.Component.callCreateMethod(Component.java:2172)
   at org.jboss.seam.Component.newInstance(Component.java:2132)
   ... 141 more


I have all ds configured right and have been using it successfully for a few years. I believe I have configured it correctly but still can't get it to work. Should I downgrade? upgrade? help is appreciated.


Top
 Profile  
 
 Post subject: Re: Seam 2.2.0.GA + Hibernate Search ClassCastException.
PostPosted: Thu May 06, 2010 3:51 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Looking at the exception I doubt it ever worked for this combo. Does Seam 2.2 and Hibernate Search work in JBoss AS 5.1 or 6?
Basically Hibernate Search wants a Hibernate session object that implements EventSource (and apparently before org.hibernate.classic.Session) and Seam does not provide that.

_________________
Emmanuel


Top
 Profile  
 
 Post subject: Re: Seam 2.2.0.GA + Hibernate Search ClassCastException.
PostPosted: Thu May 06, 2010 12:58 pm 
Newbie

Joined: Wed May 05, 2010 7:11 pm
Posts: 2
Excellent. That was it, but now I have to use AS5. :( Appreciate your help.


Top
 Profile  
 
 Post subject: Re: Seam 2.2.0.GA + Hibernate Search ClassCastException.
PostPosted: Tue May 18, 2010 3:41 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi there,
A year ago I've deployed a Seam 2.2 + Hibernate Search webapplication on JBoss 4.3(EAP), I believe CP06.
I don't have all the details available currently but I'm sure we replaced all hibernate libraries included in JBoss and it's working beatifully.

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


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