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/SearchBut 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....