-->
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.  [ 8 posts ] 
Author Message
 Post subject: Hibernate search error
PostPosted: Thu Oct 01, 2009 7:39 pm 
Newbie

Joined: Fri Sep 18, 2009 7:04 pm
Posts: 12
I'm just getting a hibernate search set up, and during the indexing phase at runtime the software throws an error:

java.lang.NoSuchFieldError: ANALYZED
at org.hibernate.search.engine.DocumentBuilderContainedEntity.getIndex(DocumentBuilderContainedEntity.java:538)

Does anyone know what this is all about? I found some postings saying that it might have to do with apache-solr-*.jar being in my lib folder, but I don't have those .jars in there. Any ideas? Thanks.

Sol


Top
 Profile  
 
 Post subject: Re: Hibernate search error
PostPosted: Fri Oct 02, 2009 4:46 am 
Pro
Pro

Joined: Wed Oct 03, 2007 2:31 pm
Posts: 205
See the below:

Quote:
you're having an old version of Lucene in classpath. Look also into solr jars, some solr classes are containing an older Lucene version.
If you checkout the full source tree from 3_1 branch you'll get an updated pom.xml too, defining some exlusions about a breaking dependency on solr.

See also http://opensource.atlassian.com/project ... SEARCH-380

_________________
Sanne



You need to check your classpath and see if you have an old version of lucene in there. If you're using maven then you can do a dependency:analyze (something similar).

Hope that helps.


Top
 Profile  
 
 Post subject: Re: Hibernate search error
PostPosted: Fri Oct 02, 2009 12:56 pm 
Newbie

Joined: Fri Sep 18, 2009 7:04 pm
Posts: 12
I checked my classpath, and the only thing I could find that shouldn't have been there was the lucene-core-2.9.jar. No apache-solr-*.jar or anything.

Now the only lucene-related libraries in my classpath are

lucene-core-2.4-dev.jar
lucene-analyzers-2.4-dev.jar
lucene-highlighter-2.4-dev.jar
lucene-memory-2.4-dev.jar
lucene-queries-2.4-dev.jar
lucene-snowball-2.4-dev.jar
lucene-spellchecker-2.4-dev.jar

Luckily getting rid of the 2.9 core got rid of the error I was having, but I now see a (almost identical) new error:

java.lang.NoSuchFieldError: NOT_ANALYZED at org.hibernate.search.engine.DocumentBuilderIndexedEntity.getDocument(DocumentBuilderIndexedEntity.java:361)

Any thoughts? Thanks much for your help.

Sol


Top
 Profile  
 
 Post subject: Re: Hibernate search error
PostPosted: Fri Oct 02, 2009 2:03 pm 
Pro
Pro

Joined: Wed Oct 03, 2007 2:31 pm
Posts: 205
Are you using maven? I could send you my pom file that I am using. Looking at what's in your classpath you shouldn't get the exception. Also I can send you a sample web app (maven) if you want to check the differences. My mail is aminmc@gmail.com.


Top
 Profile  
 
 Post subject: Re: Hibernate search error
PostPosted: Fri Oct 02, 2009 2:31 pm 
Newbie

Joined: Fri Sep 18, 2009 7:04 pm
Posts: 12
I'm not using maven, unfortunately. What's doubly weird is the fact that getting rid of the lucene-2.9-core.jar fixed the original error but still gave me this new one...Any other ideas are appreciated.

Thanks,

Sol


Top
 Profile  
 
 Post subject: Re: Hibernate search error
PostPosted: Sat Oct 03, 2009 7:28 am 
Pro
Pro

Joined: Wed Oct 03, 2007 2:31 pm
Posts: 205
Strange. The only thing I can think of is looking at your app and check. It does seem like an old version of lucene which being loaded first. Is it possible to have at look at what you're trying to do?


Top
 Profile  
 
 Post subject: Re: Hibernate search error
PostPosted: Sun Oct 04, 2009 8:32 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hello sol,
each version o Hibernate Search is tightly coupled (compiled with) a specific version of Lucene, you can replace the Lucene version as long as the public api didn't change.

The error you're seeing is most likely due to the fact that in earlier versions of Lucene the Field.Index.NOT_ANALYZED and Field.Index.ANALYZED had a very unfortunate typo. This was fixed in recent versions, but breaks compatibility, so this is now for me an indication that you're not loading the correct version of Lucene;
It appears that other projects have the bad habit to "copy-paste" Lucene inside another jar keeping the same package names, so I'd recommend you to use some classpath scanning tool like JBoss Tattletale. It's a command line tool wich produces some reports and is able to tell if you're having duplicate classes in different JARs.

An alternative is you check all your other jars (looking inside too) to not contain another copy of Lucene.

Quote:
lucene-core-2.4-dev.jar

Which version is that? shouldn't it be healthier to use lucene-core-2.4.1.jar ?

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


Top
 Profile  
 
 Post subject: Re: Hibernate search error
PostPosted: Mon Oct 05, 2009 12:37 pm 
Newbie

Joined: Fri Sep 18, 2009 7:04 pm
Posts: 12
Switching to 2.4.1 from 2.4.dev fixed the problem. Thanks all.

Sol


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