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.