-->
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: Hibernate search Unenable load indexed class
PostPosted: Tue May 01, 2007 9:24 pm 
Newbie

Joined: Tue May 01, 2007 7:06 pm
Posts: 2
Hi,
Runing Hibernate Search as stand-alone is fine. However, runing it as EJB in Jboss application got exception UNABLE LOADED INDEXED CLASS
Below is the persistence.xml, java file and stack trace

Hibernate version: 3.2.2

Mapping documents:
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/ ... ce_1_0.xsd" version="1.0">
<persistence-unit name="helloworld" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/DefaultDS</jta-data-source>
<properties>
<property name="hibernate.ejb.cfgfile"
value="hibernate.cfg.xml"/>
<property name="hibernate.search.default.indexBase"
value="c:\lucene\indexes"/>
<property name="hibernate.search.default.directory_provider"
value="org.hibernate.search.store.FSDirectoryProvider"/>
</properties>
</persistence-unit>
</persistence>

Code between sessionFactory.openSession() and session.close():
Object o = em.getDelegate();
EntityManagerImpl eml = (EntityManagerImpl)o;
Session session = eml.getSession();
javax.persistence.Query query = em.createQuery("from Message");
FullTextSession fullTextSession = Search.createFullTextSession(session);

Collection messages = query.getResultList();
Iterator it = messages.iterator();
while(it.hasNext()){
Message mesg = (Message)it.next();
System.out.println(mesg.getText());
fullTextSession.index(mesg);

}
QueryParser parser = new QueryParser("text", new StopAnalyzer()); // also tried it with contact.street as field name
org.apache.lucene.search.Query luceneQuery;
luceneQuery = parser.parse("My name*"); // want to see all streets starting with the letter 'w'
org.hibernate.Query fullTextQuery = fullTextSession.createFullTextQuery(luceneQuery);
System.out.println("fulltextquery: " + fullTextQuery.toString());
List result = fullTextQuery.list(); //EXCEPTION Throw here
System.out.println("result.size(): " + result.size());



16:49:13,785 INFO [STDOUT] fulltextquery: FullTextQueryImpl(text:my text:name*)
16:49:13,806 ERROR [STDERR] org.hibernate.search.SearchException: Unable to load indexed class: hello.Message_$$_javassist_21
16:49:13,806 ERROR [STDERR] at org.hibernate.search.engine.DocumentBuilder.getDocumentClass(DocumentBuilder.java:477)
16:49:13,806 ERROR [STDERR] at org.hibernate.search.query.FullTextQueryImpl.list(FullTextQueryImpl.java:160)
16:49:13,806 ERROR [STDERR] at ejbs.SearchBeanImp.updateIndex(SearchBeanImp.java:64)
16:49:13,806 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
16:49:13,806 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
16:49:13,806 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
16:49:13,806 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
16:49:13,806 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
16:49:13,806 ERROR [STDERR] at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
16:49:13,806 ERROR [STDERR] at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
16:49:13,806 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
16:49:13,806 ERROR [STDERR] at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)


Please help!!!
Thanks,
Luyen Tran


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 01, 2007 10:34 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
which JBoss AS version are you using?
Be sure to replace all hibernate jars (and lucene) in your server/default/lib (and client/lib) witht he version you are using in standalone.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 01, 2007 10:38 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
I believe you 're using an old version of Hibernate Search, can you try again with 3.0.0.beta1 (also you need to reindex your data).

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