-->
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.  [ 7 posts ] 
Author Message
 Post subject: Exception when initializing lucene index
PostPosted: Mon Dec 28, 2009 5:38 pm 
Beginner
Beginner

Joined: Wed Dec 16, 2009 10:34 am
Posts: 21
Hello there:

Hope you can help me with this one:

When im initializing the lucene index:

for (User user : users)
{
fullTextEntityManager.index(user);
}

there is the following exception:

NoClassDefFoundError: org/hibernate/event/PostCollectionRecreateEventListener
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at com.sun.enterprise.loader.EJBClassLoader.findClass(EJBClassLoader.java:688)
at java.lang.ClassLoader.loadClass(ClassLoader.java:303)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:

Im using the latest hibernate-core release (3.3.2) and the PostCollectionRecreateEventListener class is in that package.

I'll appreaciate the help


Top
 Profile  
 
 Post subject: Re: Exception when initializing lucene index
PostPosted: Tue Dec 29, 2009 8:02 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Quote:
com.sun.enterprise.loader.EJBClassLoader

That's GlassFish right? Where did you put Hibernate core?
I guess it's a position problem, the classloader used in this context isn't finding it. Did you bundle hibernate with your app?
I've no experience with GF, but I guess you should replace the persistence provider in the main libraries instead.

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


Top
 Profile  
 
 Post subject: Re: Exception when initializing lucene index
PostPosted: Tue Dec 29, 2009 11:10 am 
Beginner
Beginner

Joined: Wed Dec 16, 2009 10:34 am
Posts: 21
Hello:

Well... I've figured out that in the project build path the hibernate-core jar (hibernate3.jar) was added but unchecked. So i checked it and now a the new exception:

org.hibernate.search.SearchException: Failed to instantiate lucene analyzer with type null
at org.hibernate.search.impl.InitContext.initAnalyzer(InitContext.java:90)
at org.hibernate.search.impl.InitContext.<init>(InitContext.java:38)
at org.hibernate.search.impl.SearchFactoryImpl.initDocumentBuilders(SearchFactoryImpl.java:382)
at org.hibernate.search.impl.SearchFactoryImpl.<init>(SearchFactoryImpl.java:119

I guess that is happening when i use this line of code:

QueryParser parser = new QueryParser(Version.LUCENE_30, "firstName", new StandardAnalyzer(Version.LUCENE_30));
org.apache.lucene.search.Query query = parser.parse(stringToFind);

I'm totally clueless.
Do you know if i have to do any configuration in the glassfish libraries or the application files: web..xml or persistence.xml or application.xml ?


Top
 Profile  
 
 Post subject: Re: Exception when initializing lucene index
PostPosted: Tue Dec 29, 2009 11:19 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hello,
next release of Hibernate Search will support Lucene 3, but this is not yet ready. Please use version 2.4.1 with Search 3.1.1

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


Top
 Profile  
 
 Post subject: Re: Exception when initializing lucene index
PostPosted: Tue Dec 29, 2009 12:10 pm 
Beginner
Beginner

Joined: Wed Dec 16, 2009 10:34 am
Posts: 21
Yes !!

i was using lucene 3.0.0. I changed it to 2.4.1 and i guess the problem is gone.

Thank you for your help.


Top
 Profile  
 
 Post subject: Re: Exception when initializing lucene index
PostPosted: Fri May 14, 2010 8:41 am 
Newbie

Joined: Sun Feb 24, 2008 5:12 pm
Posts: 9
When are you planning to support Lucene 3?
I have heard that it is much faster that the previous version and I am really interested in giving it a try!

Kind regards


Top
 Profile  
 
 Post subject: Re: Exception when initializing lucene index
PostPosted: Fri May 14, 2010 11:49 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
hi,
sure we're working on that.

release 3.2 is using Lucene 2.9 for this reason: it's compatible with old APIs but having all nice new features from version 3 (including performance), so you can use it already.
If you can 1) avoid to use "COMPRESS" fields and 2) avoid the experimental DSL API, you can already drop in the new version of Lucene.

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