-->
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.  [ 6 posts ] 
Author Message
 Post subject: java.lang.NoClassDefFoundError: org/hibernate/search/Search
PostPosted: Thu Jun 26, 2008 5:44 am 
Newbie

Joined: Thu Jun 26, 2008 5:22 am
Posts: 4
Hello

I'm currently using Hibernate with Annotations in a web app (it works well) and i would now use Hibernate Search

But each time I use these lines :

Code:
Session hibsession = HibernateUtil.getSession();
FullTextSession fullTextSession = Search.createFullTextSession(hibsession);


The JSP is built but if i try to display the page that call these lines an error occurs :

java.lang.NoClassDefFoundError: org/hibernate/search/Search

But I've checked many times, this class is present in the library hibernate-search-3.0.1.GA
And I absolutely need to execute this code to perform a first manual indexing and to execute queries

My eclipse classpath file :

Code:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
   <classpathentry kind="src" path="src"/>
   <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
   <classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v5.5"/>
   <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
   <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
   <classpathentry kind="lib" path="N:/classes/jar/mysql/mysql-connector-java-5.0.8-bin.jar"/>
   <classpathentry kind="lib" path="N:/classes/jar/javax/persistence-api-1.0.jar" />
   <classpathentry kind="lib" path="N:/classes/jar/javax/servlet-api-2.3.jar">
   </classpathentry>
   <classpathentry kind="lib" path="N:/classes/jar/hibernate/hibernate-3.2.4.ga.jar">
   </classpathentry>
   <classpathentry kind="lib" path="N:/classes/jar/hibernate/hibernate-annotations-3.3.0.ga.jar">
   </classpathentry>
   <classpathentry kind="lib" path="N:/classes/jar/hibernate/hibernate-commons-annotations-3.0.0.ga.jar"/>
   <classpathentry kind="lib" path="N:/classes/jar/common/commons-collections-3.2.jar"/>
   <classpathentry kind="lib" path="N:/classes/jar/common/commons-logging-1.1.jar"/>
   <classpathentry kind="lib" path="N:/classes/jar/j2ee/javaee.1.5.jar"/>
   <classpathentry kind="lib" path="N:/classes/jar/dom4j/dom4j-1.6.1.jar"/>
   <classpathentry kind="lib" path="N:/classes/jar/cglib/cglib-2.1_3.jar"/>
   <classpathentry kind="lib" path="N:/classes/jar/ehcache/ehcache-1.2.3.jar"/>
   <classpathentry kind="lib" path="N:/classes/jar/log4j/log4j-1.2.13.jar"/>
   <classpathentry kind="lib" path="N:/classes/jar/asm/asm-1.5.3.jar"/>
   <classpathentry kind="lib" path="N:/classes/jar/antlr/antlr-2.7.6.jar"/>
   <classpathentry kind="lib" path="N:/classes/jar/j2ee/j2eeAtos.13.jar"/>
   <classpathentry kind="lib" path="D:/sources/hibernate-pim-web/lib/hibernate-search.jar">
   </classpathentry>
   <classpathentry kind="lib" path="D:/hibernate/hibernate-search-3.0.1.GA/lib/lucene-core-2.3.0.jar"/>
   <classpathentry kind="lib" path="D:/hibernate/hibernate-search-3.0.1.GA/lib/jms.jar"/>
   <classpathentry kind="output" path="build/classes"/>
</classpath>


hibernate.cfg.xml

Code:
<hibernate-configuration>
    <session-factory>
         
        <property name="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</property>
         
        <!-- Utilisation d'un pool de conexions géré par Tomcat -->
        <!-- Ce pool est paramétré dans le server.xml de Tomcat  -->
        <property name="hibernate.connection.datasource">java:comp/env/jdbc/PIM_DATA</property>
       
        <!-- Stockage index de recherche -->
      <property name="hibernate.search.default.directory_provider">org.hibernate.search.store.FSDirectoryProvider</property>
        <property name="hibernate.search.default.indexBase">/indexes/</property>
        <!-- analyseur pour recherche -->
        

        <!-- Affichage pour debug -->
        <property name="show_sql">true</property>
        <property name="hibernate.use_sql_comments">true</property>

        <!-- Cache de niveau 2 : perfs -->
        <property name="hibernate.cache.use_second_level_cache">true</property>
        <property name="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider   </property>
       
        <!-- Infos de mapping -->
        <mapping class="pim.AbDevice" />
        <mapping class="pim.AbContact" />
        <mapping class="pim.AbAddress" />
        <mapping class="pim.UserServices" />
       
        <!-- Configuration du cache de niveau 2 -->
        <class-cache class="pim.UserServices" usage="nonstrict-read-write" include="all"/>
       
    </session-factory>
</hibernate-configuration>



Please help....


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 26, 2008 6:44 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
if it compiles it means you have the correct jar in your project classpath,
but having this error means the jar is not there in your web application classpath.

what is your jsp container?

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


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 26, 2008 8:02 am 
Newbie

Joined: Thu Jun 26, 2008 5:22 am
Posts: 4
Thanks for your reply

I'm using Tomcat 5.5

I start the server from eclipse


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 26, 2008 8:08 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
ok, you should check if the search jar is in the same place as the other hibernate jars you are using.
If you are starting tomcat from inside eclipse you should configure it to export the search.jar to the webapp; check if it is getting exported to the war as other libs to.

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


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 26, 2008 8:10 am 
Newbie

Joined: Thu Jun 26, 2008 5:22 am
Posts: 4
Ok thanks I've fixed it thanks to you !


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 26, 2008 8:20 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
nice, you're welcome!

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