3 Replies Latest reply on Oct 28, 2007 10:01 AM by optimistic

    Seam 2.0.0 and hibernate search

    optimistic Newbie


      Did someone tried succesfully to configure hibernate search with seam2 ?

      I'm evaluating the seam & hsearch solution and need a little help.

      I have a problem to create an index. I have a seam-gen generated project and configured hibernate search following way:


      <?xml version="1.0" encoding="UTF-8"?>
      <!-- Persistence deployment descriptor for prod profile -->
      <persistence xmlns="http://java.sun.com/xml/ns/persistence"
       xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
       <persistence-unit name="crud9">
      <!-- <property name="hibernate.hbm2ddl.auto" value="validate"/> -->
       <property name="hibernate.cache.use_query_cache" value="true"/>
       <property name="hibernate.jdbc.batch_size" value="20"/>
       <property name="jboss.entity.manager.factory.jndi.name" value="java:/crud9EntityManagerFactory"/>
       <property name="hibernate.default_schema" value="core"/>
       <!-- use a file system based index -->
       <property name="hibernate.search.default.directory_provider"
       <!-- directory where the indexes will be stored -->
       <property name="hibernate.search.default.indexBase"


      <?xml version="1.0" encoding="UTF-8"?>
      <application xmlns="http://java.sun.com/xml/ns/javaee"
       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd"
       <!-- Seam and EL -->

      Entity annotations:

      @Table(name = "products")
      public class PrProduct implements java.io.Serializable {
       @Column(name = "product_id", unique = true, nullable = false, length = 20)
       @Length(max = 20)
       public String getProductId() {
       return this.productId;
       @Column(name = "name", length = 128)
       @Length(max = 128)
       public String getName() {
       return this.name;
       public void setName(String name) {
       this.name = name;
       @Column(name = "desc", length = 4000)
       @Length(max = 4000)
       public String geDesc() {
       return this.desc;

      More fields (ca 10), but I tried to index theese...

      I don't become any error, but I don't see anything under /data/hs_index after I run following indexing code:

      public class PrProductHome extends EntityHome<PrProduct> {
       EntityManager entityManager;
       public String createHsIndex(){
       try {
       FullTextEntityManager ftEm = (FullTextEntityManager) entityManager;
       Query q = entityManager.createQuery("select prProduct from PrProduct prProduct");
       List<PrProduct> products = q.setMaxResults(200).getResultList();
       for (PrProduct prProduct : products) {
       } catch (Exception e) {
       log.error("Probleeeem: #0", e.getMessage());
       return "OK";

      Can you give me a hint what's wrong or where to search ???

      Versions: (From JBoss Log)
      Hibernate EntityManager 3.2.1.GA
      Hibernate Annotations 3.2.1.GA
      Hibernate 3.2.4.sp1
      Hibernate Search 3.0.0.CR1.HSEARCH-116

      Thank you,