-->
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.  [ 7 posts ] 
Author Message
 Post subject: Hibernate Search is not enabled
PostPosted: Thu Apr 14, 2011 6:35 pm 
Newbie

Joined: Thu Apr 14, 2011 5:55 pm
Posts: 4
Hi,

I'm working on an Maven EAR project (One Web Project and one EJB Project), I've already added the corresponding annotations ton index some entities and maven has already downloaded the Hibernate Search 3.3.0.Final libraries and their dependencies to the EJB project.

However, the index file structure is not being created when I run the EAR. I'm using Glassfish Server 3.1 and the only strange thing I see on it's log is the following line:

Code:
INFO: Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.


and that is really weird since maven is downloading the Hibernate Search libraries to the EJB and this project is on the EAR dependencies.

Could you guys give me any clue on how to solve this problem?

These are the properties the persistence unit
Code:
   
    <properties>
        <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
        <property name="hibernate.show_sql" value="true"/>
        <property name="hibernate.format_sql" value="true"/>
        <property name="hibernate.search.default.directory_provider" value="org.hibernate.search.store.FSDirectoryProvider"/>
        <property name="hibernate.search.default.indexBase" value="/home/totem1/rutas/lucene/index"/>
    </properties>


Top
 Profile  
 
 Post subject: Re: Hibernate Search is not enabled
PostPosted: Fri Apr 15, 2011 3:30 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Looks like a class loading issue to me. The event listener is actually loaded by Hibernate Core. It tries to find the listener on the classpath and if it finds it loads it and enables this way Hibernate Search. It seems that in your environment Hibernate Core cannot "see" the Hibernate Search classes. Maybe you could describe the structure of the ear file including the libraries. Where is Core, where Search? Do you have any global shared libraries?

--Hardy


Top
 Profile  
 
 Post subject: Re: Hibernate Search is not enabled
PostPosted: Fri Apr 15, 2011 12:22 pm 
Newbie

Joined: Thu Apr 14, 2011 5:55 pm
Posts: 4
Hi Hardy, thanks for the reply!

My project is a Maven Entreprise Application with the following modules:

Code:
<modules>
        <module>Rut-ear</module>
        <module>Rut-web</module>
        <module>Rut-ejb</module>
        <module>Rutdmin-web</module>
    </modules>


Rut-ejb module contains the following dependencies:

Code:
<dependencies>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-io</artifactId>
            <version>1.3.2</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>6.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.2</version>
            <scope>test</scope>
        </dependency>       
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-search</artifactId>
            <version>3.3.0.Final</version>
        </dependency>             
        <dependency>
            <groupId>com.totem</groupId>
            <artifactId>Namu</artifactId>
            <version>1.0-FINAL</version>
        </dependency>
    </dependencies>


And the following libraries:

- commons-io-1.3.2.jar
- hibernate-search-3.3.0.Final.jar
- javaee-api-6.0.jar [provided]
- antlr-2.7.6.jar
- commons-collections-3.1.jar
- dom4j-1.6.1.jar
- hibernate-commons-annotations-3.2.0.Final.jar
- hibernate-core-3.6.0.Final.jar
- hibernate-jpa-2.0-api-1.0.0.Final.jar
- hibernate-search-analyzers-3.3.0.Final.jar
- jta-1.1.jar
- lucene-analyzers-3.0.3.jar
- lucene-core-3.0.3.jar
- lucene-snowball-3.0.3.jar
- slf4j-api-1.6.1.jar
- solr-core-1.4.1.jar
- solr-solrj-1.4.1.jar
- Namu-1.0.jar (Company project with custom analyzers)

The Persistence Unit is also on the Rut-ejb module

The Rut-ear module, the one we run, has the following dependencies on it's POM:
Code:
<dependencies>
        <dependency>
            <groupId>com.tot/groupId>
            <artifactId>Rut-ejb</artifactId>
            <version>1.0</version>
            <type>ejb</type>
        </dependency>
        <dependency>
            <groupId>com.tot</groupId>
            <artifactId>Rut-web</artifactId>
            <version>1.0</version>
            <type>war</type>
        </dependency>       
    </dependencies>


Excuse for my ignorance but I don't know what a global shared library is.

By the way, I've created a single test Maven Web Module, with the same hibernate search dependency and same persistence unit properties I used on Rut-ejb module, and the index is properly created, that makes me think I'm doing something wrong on the Maven Enterprise Application configuration.

Regards


Last edited by totem on Thu Jul 07, 2011 2:31 pm, edited 2 times in total.

Top
 Profile  
 
 Post subject: Re: Hibernate Search is not enabled
PostPosted: Fri Apr 15, 2011 2:43 pm 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

I expected more a description on the file level (not maven config). What is the the result of jar -tvf myear.ear, jar -tvf mywar.war, jar -tvf myear.ear. Is the packaging as you envision by the given maven configuration? With global libraries I mean libraries in the shared library directory of the application server. I am not a 100% about glassfish, but I would assume it has such a concept as well.

--Hardy


Top
 Profile  
 
 Post subject: Re: Hibernate Search is not enabled
PostPosted: Fri Apr 15, 2011 5:16 pm 
Newbie

Joined: Thu Apr 14, 2011 5:55 pm
Posts: 4
Hi, thanks for the help,

here is the description you've asked for:

jar -tvf Rut-ear.ear
Code:
     0 Fri Apr 15 09:15:02 CST 2011 META-INF/
   125 Fri Apr 15 09:15:00 CST 2011 META-INF/MANIFEST.MF
71283 Fri Apr 15 09:15:00 CST 2011 hibernate-commons-annotations-3.2.0.Final.jar
87776 Fri Apr 15 09:15:00 CST 2011 commons-io-1.3.2.jar
100884 Fri Apr 15 09:15:00 CST 2011 hibernate-jpa-2.0-api-1.0.0.Final.jar
115257 Fri Apr 15 09:15:00 CST 2011 lucene-snowball-3.0.3.jar
1126046 Fri Apr 15 09:15:00 CST 2011 solr-core-1.4.1.jar
23633 Fri Apr 15 09:15:00 CST 2011 Namu-1.0-FINAL.jar
559366 Fri Apr 15 09:15:00 CST 2011 commons-collections-3.1.jar
25496 Fri Apr 15 09:15:00 CST 2011 slf4j-api-1.6.1.jar
1034173 Fri Apr 15 09:15:00 CST 2011 lucene-core-3.0.3.jar
3083100 Fri Apr 15 09:15:00 CST 2011 hibernate-core-3.6.0.Final.jar
   536 Fri Apr 15 09:15:00 CST 2011 META-INF/application.xml
561362 Fri Apr 15 09:15:00 CST 2011 hibernate-search-3.3.0.Final.jar
443432 Fri Apr 15 09:15:00 CST 2011 antlr-2.7.6.jar
313898 Fri Apr 15 09:15:00 CST 2011 dom4j-1.6.1.jar
9003665 Fri Apr 15 09:15:00 CST 2011 Rut-web-1.0.war
200980 Fri Apr 15 09:15:00 CST 2011 lucene-analyzers-3.0.3.jar
211460 Fri Apr 15 09:15:00 CST 2011 Rut-ejb-1.0.jar
141928 Fri Apr 15 09:15:00 CST 2011 hibernate-search-analyzers-3.3.0.Final.jar
250955 Fri Apr 15 09:15:00 CST 2011 solr-solrj-1.4.1.jar
15071 Fri Apr 15 09:15:00 CST 2011 jta-1.1.jar
     0 Fri Apr 15 09:15:04 CST 2011 META-INF/maven/
     0 Fri Apr 15 09:15:04 CST 2011 META-INF/maven/com.tot/
     0 Fri Apr 15 09:15:04 CST 2011 META-INF/maven/com.tot/Rut-ear/
  2253 Fri Apr 08 10:50:06 CST 2011 META-INF/maven/com.tot/Rut-ear/pom.xml
   107 Fri Apr 15 09:15:02 CST 2011 META-INF/maven/com.tot/Rut-ear/pom.properties



jar -tvf Rut-ejb.jar

Code:
0 Fri Apr 15 09:14:24 CST 2011 META-INF/
   125 Fri Apr 15 09:14:22 CST 2011 META-INF/MANIFEST.MF
     0 Fri Apr 08 10:50:26 CST 2011 com/
     0 Fri Apr 08 10:50:26 CST 2011 com/tot/
     0 Fri Apr 08 10:50:28 CST 2011 com/tot/rut/
     0 Fri Apr 08 10:50:28 CST 2011 com/tot/rut/session/
     0 Fri Apr 08 10:50:28 CST 2011 com/tot/rut/session/usuarios/
     0 Fri Apr 08 10:50:28 CST 2011 com/tot/rut/entity/
     0 Fri Apr 08 10:50:28 CST 2011 com/tot/rut/entity/usuarios/
...
  3896 Thu Apr 14 16:05:26 CST 2011 META-INF/persistence.xml
1712034 Fri Apr 08 10:50:24 CST 2011 META-INF/Rut-ejb.dbschema
     0 Fri Apr 15 09:14:24 CST 2011 META-INF/maven/
     0 Fri Apr 15 09:14:24 CST 2011 META-INF/maven/com.totem/
     0 Fri Apr 15 09:14:24 CST 2011 META-INF/maven/com.tot/Rut-ejb/
  5237 Fri Apr 15 09:14:02 CST 2011 META-INF/maven/com.tot/Rut-ejb/pom.xml
   107 Fri Apr 15 09:14:24 CST 2011 META-INF/maven/com.tot/Rut-ejb/pom.properties


jar -tvf Rut-web.war (I removed some pages, classes, images an other irrelevant files to shorten up this post)
Code:
    0 Fri Apr 15 14:39:44 CST 2011 META-INF/
   124 Fri Apr 15 14:39:42 CST 2011 META-INF/MANIFEST.MF
     0 Fri Apr 15 10:26:48 CST 2011 temas/
     0 Fri Apr 15 10:26:48 CST 2011 temas/start/
     0 Fri Apr 15 10:26:48 CST 2011 WEB-INF/
     0 Fri Apr 15 10:26:48 CST 2011 WEB-INF/classes/
     0 Fri Apr 15 10:26:48 CST 2011 WEB-INF/facelets/
     0 Fri Apr 15 10:26:50 CST 2011 WEB-INF/lib/
     0 Fri Apr 15 10:26:48 CST 2011 plantillas/
     0 Fri Apr 15 10:47:10 CST 2011 css/
  1391 Fri Feb 25 16:37:36 CST 2011 WEB-INF/classes/log4j.properties
   526 Fri Feb 18 09:36:46 CST 2011 WEB-INF/sun-web.xml
  3583 Wed Apr 13 15:47:54 CST 2011 WEB-INF/facelets/facelets.taglib.xml
49225 Wed Apr 06 11:11:44 CST 2011 WEB-INF/lib/jersey-multipart-1.3.jar
352291 Fri Feb 25 16:43:36 CST 2011 WEB-INF/lib/log4j-1.2.9.jar
626046 Wed Apr 06 11:11:48 CST 2011 WEB-INF/lib/jersey-server-1.3.jar
89967 Thu Jan 06 11:04:54 CST 2011 WEB-INF/lib/jaxb-api-2.1.jar
23346 Thu Jan 06 11:04:56 CST 2011 WEB-INF/lib/stax-api-1.0-2.jar
104452 Thu Jan 06 11:05:02 CST 2011 WEB-INF/lib/jackson-core-asl-1.1.1.jar
  8557 Wed Apr 06 11:11:46 CST 2011 WEB-INF/lib/oauth-client-1.3.jar
26514 Thu Jan 06 11:04:34 CST 2011 WEB-INF/lib/stax-api-1.0.1.jar
21373 Wed Apr 06 11:11:48 CST 2011 WEB-INF/lib/oauth-signature-1.3.jar
62983 Thu Jan 06 11:05:00 CST 2011 WEB-INF/lib/activation-1.1.jar
407104 Wed Apr 06 11:11:46 CST 2011 WEB-INF/lib/jersey-core-1.3.jar
1787812 Wed Apr 13 11:47:58 CST 2011 WEB-INF/lib/primefaces-3.0.M1.jar
43033 Thu Jan 06 11:04:24 CST 2011 WEB-INF/lib/asm-3.1.jar
67758 Thu Jan 06 11:04:30 CST 2011 WEB-INF/lib/jettison-1.1.jar
138244 Wed Apr 06 11:11:42 CST 2011 WEB-INF/lib/jersey-json-1.3.jar
116106 Wed Apr 06 11:11:44 CST 2011 WEB-INF/lib/jersey-client-1.3.jar
39165 Wed Apr 06 11:11:46 CST 2011 WEB-INF/lib/mimepull-1.4.jar
46367 Thu Jan 06 11:04:20 CST 2011 WEB-INF/lib/jsr311-api-1.1.1.jar
59590 Fri Feb 25 16:43:36 CST 2011 WEB-INF/lib/commons-fileupload-1.2.2.jar
867801 Thu Jan 06 11:04:48 CST 2011 WEB-INF/lib/jaxb-impl-2.1.12.jar
  3260 Wed Apr 13 11:05:18 CST 2011 WEB-INF/faces-config.xml
  2554 Mon Apr 04 16:55:30 CST 2011 WEB-INF/web.xml
  9635 Thu Apr 07 12:11:38 CST 2011 plantillas/plantillaMapa.xhtml
  5409 Thu Apr 07 10:37:36 CST 2011 plantillas/plantillaGeneral.xhtml
  4449 Fri Feb 18 09:36:46 CST 2011 css/def.css
17529 Fri Apr 15 10:47:10 CST 2011 css/ru.css
  2383 Fri Feb 18 09:36:46 CST 2011 css/sprite-mapas.css
13594 Fri Feb 25 16:37:36 CST 2011 css/sprite-tema.css
     0 Fri Apr 15 14:39:50 CST 2011 META-INF/maven/
     0 Fri Apr 15 14:39:50 CST 2011 META-INF/maven/com.tot/
     0 Fri Apr 15 14:39:50 CST 2011 META-INF/maven/com.tot/Rut-web/
  6599 Thu Apr 14 09:30:10 CST 2011 META-INF/maven/com.tot/Rut-web/pom.xml
   107 Fri Apr 15 14:39:44 CST 2011 META-INF/maven/com.tot/Rut-web/pom.properties


About the shared libraries, yes, my glassfish contains some libraries on the shared libraries folder that are also on my classpath, for example:

- hibernate3.jar (hibernate-distribution-3.6.0.Final)
- hibernate-jpa-2.0-api-1.0.0.Final.jar
- jta-1.1.jar
- slf4j-api-1.6.1.jar
- slf4j-jdk14-1.6.1.jar
- dom4j-1.6.1.jar
- commons-collections-3.1.jar
- antlr-2.7.6.jar

Regards!


Last edited by totem on Thu Jul 07, 2011 2:36 pm, edited 2 times in total.

Top
 Profile  
 
 Post subject: Re: Hibernate Search is not enabled
PostPosted: Sat Apr 16, 2011 7:12 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
it seems you are having many hibernate libraries deployed both in your EAR and in your "shared libraries folder". that's going to get much trouble, make sure each jar exists only once on the classpath of your application (which is the combination of your ear and the shared libraries).
In Maven, you can mark dependencies as "provided" if they're going to be provided by the application server so that you have them on classpath while compiling / testing, but to not include them in the generated EAR.

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


Top
 Profile  
 
 Post subject: Re: Hibernate Search is not enabled
PostPosted: Tue Apr 19, 2011 10:39 am 
Newbie

Joined: Thu Apr 14, 2011 5:55 pm
Posts: 4
Hi Sanne, thanks for the reply,


unfortunately I tried marking the duplicated dependencies as provided and even excluding them but still not working.

One strange thing: I've created an independent web project using the same dependencies, and same persistence.xml, added some entities and session bean and hibernates search gets enabled and the indexes are created properly.


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