-->
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.  [ 2 posts ] 
Author Message
 Post subject: Loader constraint violation in hibernate createFullTextQuery
PostPosted: Wed Sep 08, 2010 8:09 am 
Newbie

Joined: Wed Sep 08, 2010 8:03 am
Posts: 1
I have a webapplication using Hibernate and Jpa and want to add search via hibernate-search. I use the following hibernate versions: hibernate-core-3.5.5-Final
hibernate-commons-annotations-3.3.0.ga
hibernate-annotations-3.5.5-Final
hibernate-entitymanager-3.5.5-Final
hibernate-search-3.2.1.Final
hibernate-jpa-2.0-api-1.0.0.Final
And for lucene: lucene-core-2.9.3

The following code compiles perfectly fine:

Code:
public List<Story> search(org.apache.lucene.search.Query luceneQuery, int offset, int limit) {
    try {
        FullTextEntityManager ftem = Search.getFullTextEntityManager(entityManager);

        javax.persistence.Query query = ftem.createFullTextQuery(luceneQuery, Story.class);
        query.setFirstResult(offset);
        query.setMaxResults(limit);

        return query.getResultList();
    }
    catch(NoResultException ex) {
        return new ArrayList<Story>();
    }
}


Now, this is where the fun starts, as this is the error I get upon using the above method:

Quote:
java.lang.LinkageError: loader constraint violation: when resolving interface method "org.hibernate.search.jpa.FullTextEntityManager.createFullTextQuery(Lorg/apache/lucene/search/Query;[Ljava/lang/Class;)Lorg/hibernate/search/jpa/FullTextQuery;" the class loader (instance of org/apache/catalina/loader/WebappClassLoader) of the current class, nl/dela/familieportret/dao/jpa/StoryDaoJpa, and the class loader (instance of org/apache/catalina/loader/StandardClassLoader) for resolved class, org/hibernate/search/jpa/FullTextEntityManager, have different Class objects for the type org/apache/lucene/search/Query used in the signature


At first I thought hibernate-search was compiled to another version of lucene, but this particular version of hibernate-search even ships with lucene-2.9.3.

I'm not sure where to start looking, so any help would be appreciated.

BTW, I'm using maven, struts 2 and spring 3 if that is any help.


Top
 Profile  
 
 Post subject: Re: Loader constraint violation in hibernate createFullTextQuery
PostPosted: Thu Sep 09, 2010 10:12 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
In which container are you deploying the application? Could it be that there are some library conflict with some shared libraries in the container? Or is the behavior also happening in say a unit test? You should specify "upon using the above method" - where and how.

--Hardy


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.