-->
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: DelegateNamedAnalyzer not found in Hibernate-search 4.2.0
PostPosted: Thu Jan 24, 2013 9:19 am 
Regular
Regular

Joined: Fri Feb 04, 2011 8:34 pm
Posts: 66
Hi,

I am getting the following very strange exception when I deployed my ejb module:

Quote:
Caused by: java.lang.ClassNotFoundException: org.hibernate.search.util.impl.DelegateNamedAnalyzer from [Module "deployment.ForestSurf-ear-1.0.ear:main" from Service Module Loader]


I searched around and found that the DelegateNamedAnalyzer is ONLY available in hibernate-search-engine-4.2.0.Final.jar.
Why hibernate-search-4.2.0 invoke DelegateNamedAnalyzer while this class is inclued in hibernate-search-engine-4.2.0?
I tried to include hibernate-search-engine-4.2.0 in the pom.xml in my project, but it ended up with other "class not found" exception as shown below during compile time:

Code:
import org.hibernate.search.annotations.Latitude;
import org.hibernate.search.annotations.Longitude;
import org.hibernate.search.annotations.Parameter;
import org.hibernate.search.annotations.Resolution;
import org.hibernate.search.annotations.Spatial;


The Latitude, LOngitude Spatial classes are not found when I include hibernate-sesarch-engine-4.2.0 in the build.

Can anyone please point me in the right direction how to setup my pom.xml file, so that it include the DelegateNamedAnalyzer class, Longitude, Latutde and Spatial class in the build?

Here is my pom.xml file:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
    <artifactId>ForestSurf</artifactId>
    <groupId>ForestSurf</groupId>
    <version>1.0</version>
  </parent>

    <groupId>ForestSurf</groupId>
    <artifactId>ForestSurf-ejb</artifactId>
    <version>1.0</version>
    <packaging>ejb</packaging>

    <name>ForestSurf-ejb</name>

    <properties>
        <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <log4j.version>1.2.14</log4j.version>
        <hibernate.version>4.1.7.Final</hibernate.version>
        <org.springframework-version>3.0.7.RELEASE</org.springframework-version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>4.1.9.Final</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-annotations</artifactId>
            <version>3.5.6-Final</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-infinispan</artifactId>
                <version>4.1.9.Final</version>
                <scope>provided</scope>
        </dependency>
        <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-entitymanager</artifactId>
                <version>4.1.9.Final</version>
                <scope>provided</scope>
        </dependency>
        <dependency>
                <groupId>org.hibernate.javax.persistence</groupId>
                <artifactId>hibernate-jpa-2.0-api</artifactId>
                <version>1.0.1.Final</version>
                <scope>provided</scope>
        </dependency>
               
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-search</artifactId>
            <version>4.2.0.Final</version>
        </dependency>

        <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-search-orm</artifactId>
                <version>4.2.0.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-envers</artifactId>
            <version>4.1.9.Final</version>
            <scope>provided</scope>

            <exclusions>
                <exclusion>
                    <groupId>dom4j</groupId>
                    <artifactId>dom4j</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
            <version>3.2.0.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>6.0</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
                <groupId>org.apache.lucene</groupId>
                <artifactId>lucene-snowball</artifactId>
                <version>3.0.3</version>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-core</artifactId>
            <version>4.0.0</version>
        </dependency>
       
        <dependency>
                <groupId>org.apache.lucene</groupId>
                <artifactId>lucene-analyzers-common</artifactId>
                <version>4.0.0</version>
        </dependency>
       
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.6</version>
        </dependency>
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <version>2.1</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.7.2</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.8.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                    <compilerArguments>
                        <endorseddirs>${endorsed.dir}</endorseddirs>
                    </compilerArguments>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-ejb-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <ejbVersion>3.1</ejbVersion>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.1</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${endorsed.dir}</outputDirectory>
                            <silent>true</silent>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>javax</groupId>
                                    <artifactId>javaee-endorsed-api</artifactId>
                                    <version>6.0</version>
                                    <type>jar</type>
                                </artifactItem>
<!--                                <artifactItem>
                                    <groupId>org.hibernate</groupId>
                                    <artifactId>hibernate-search</artifactId>
                                    <version>4.2.0.Final</version>
                                    <type>jar</type>
                                </artifactItem>-->
                            </artifactItems>
                        </configuration>
                    </execution>
                   
                </executions>
            </plugin>
        </plugins>
    </build>

</project>


Any suggestion is very much appreciated.
Thanks
Sam


Top
 Profile  
 
 Post subject: Re: DelegateNamedAnalyzer not found in Hibernate-search 4.2.0
PostPosted: Fri Jan 25, 2013 8:14 am 
Hibernate Team
Hibernate Team

Joined: Fri Sep 09, 2011 3:18 am
Posts: 295
Hi,
In your pom.xml dependencies you should only include the artifact hibernate-search, hibernate-search-engine is a transitive dependecy of this project and you don't need to specify it.

I think the EAR you are creating doesn't contain the hibernate-search dependencies.
When you are using the maven-dependency-plugin there are two goals you can use:

copy: in this case you have to specify every artifact you want to include in the EAR.
copy-dependencies: this will copy in the EAR all the dependencies you have defined in the project including the transitive ones.

You will find more information about the plugin on this page: https://maven.apache.org/plugins/maven-dependency-plugin/usage.html

Hope this help


Top
 Profile  
 
 Post subject: Re: DelegateNamedAnalyzer not found in Hibernate-search 4.2.0
PostPosted: Sat Jan 26, 2013 8:27 pm 
Regular
Regular

Joined: Fri Feb 04, 2011 8:34 pm
Posts: 66
HI I don't know what hibernate search dependencies are missing from the package.

There is no compilation error. The following exception is caused when I deploy the ear project to jboss server (7.1.1.Final):

Quote:
11:23:39,632 WARN [org.jboss.modules] (MSC service thread 1-7) Failed to define class org.hibernate.search.util.impl.DelegateNamedAnalyzer in Module "deployment.ForestSurf-ear-1.0.ear:main" from Service Module Loader: java.lang.VerifyError: class org.hibernate.search.util.impl.DelegateNamedAnalyzer overrides final method tokenStream.(Ljava/lang/String;Ljava/io/Reader;)Lorg/apache/lucene/analysis/TokenStream;
at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.6.0_07]
at java.lang.ClassLoader.defineClass(ClassLoader.java:620) [rt.jar:1.6.0_07]
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) [rt.jar:1.6.0_07]
at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327)
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391)
at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243)
at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73)
at org.jboss.modules.Module.loadModuleClass(Module.java:517)
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) [rt.jar:1.6.0_07]
at org.hibernate.search.spi.SearchFactoryBuilder.initDocumentBuilders(SearchFactoryBuilder.java:365) [hibernate-search-engine-4.2.0.Final.jar:4.2.0.Final]
at org.hibernate.search.spi.SearchFactoryBuilder.buildNewSearchFactory(SearchFactoryBuilder.java:222) [hibernate-search-engine-4.2.0.Final.jar:4.2.0.Final]
at org.hibernate.search.spi.SearchFactoryBuilder.buildSearchFactory(SearchFactoryBuilder.java:146) [hibernate-search-engine-4.2.0.Final.jar:4.2.0.Final]
at org.hibernate.search.event.impl.FullTextIndexEventListener.initialize(FullTextIndexEventListener.java:130) [hibernate-search-orm-4.2.0.Final.jar:4.2.0.Final]
at org.hibernate.search.hcore.impl.HibernateSearchIntegrator.integrate(HibernateSearchIntegrator.java:83) [hibernate-search-orm-4.2.0.Final.jar:4.2.0.Final]
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:303) [hibernate-core-4.1.9.Final.jar:4.1.9.Final]
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1750) [hibernate-core-4.1.9.Final.jar:4.1.9.Final]
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:94) [hibernate-entitymanager-4.1.9.Final.jar:4.1.9.Final]
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:905) [hibernate-entitymanager-4.1.9.Final.jar:4.1.9.Final]
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:890) [hibernate-entitymanager-4.1.9.Final.jar:4.1.9.Final]
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:74) [hibernate-entitymanager-4.1.9.Final.jar:4.1.9.Final]
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:162) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.start(PersistenceUnitServiceImpl.java:85) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) [rt.jar:1.6.0_07]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) [rt.jar:1.6.0_07]
at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_07]

11:23:39,641 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC00001: Failed to start service jboss.persistenceunit."ForestSurf-ear-1.0.ear/ForestSurf-ejb-1.0.jar#ForestSurfPU": org.jboss.msc.service.StartException in service jboss.persistenceunit."ForestSurf-ear-1.0.ear/ForestSurf-ejb-1.0.jar#ForestSurfPU": Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) [rt.jar:1.6.0_07]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) [rt.jar:1.6.0_07]
at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_07]
Caused by: java.lang.NoClassDefFoundError: org/hibernate/search/util/impl/DelegateNamedAnalyzer
at org.hibernate.search.spi.SearchFactoryBuilder.initDocumentBuilders(SearchFactoryBuilder.java:365)
at org.hibernate.search.spi.SearchFactoryBuilder.buildNewSearchFactory(SearchFactoryBuilder.java:222)
at org.hibernate.search.spi.SearchFactoryBuilder.buildSearchFactory(SearchFactoryBuilder.java:146)
at org.hibernate.search.event.impl.FullTextIndexEventListener.initialize(FullTextIndexEventListener.java:130)
at org.hibernate.search.hcore.impl.HibernateSearchIntegrator.integrate(HibernateSearchIntegrator.java:83)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:303)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1750)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:94)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:905)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:890)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:74)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:162)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.start(PersistenceUnitServiceImpl.java:85)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
... 3 more
Caused by: java.lang.ClassNotFoundException: org.hibernate.search.util.impl.DelegateNamedAnalyzer from [Module "deployment.ForestSurf-ear-1.0.ear:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.1.GA]


Here is a list of the files in the ear file:

Quote:
-rw-r--r-- 1 jboss jboss 443432 Jan 26 01:23 antlr-2.7.6.jar
-rw-r--r-- 1 jboss jboss 4467 Jan 26 01:23 aopalliance-1.0.jar
-rw-r--r-- 1 jboss jboss 292816 Jan 26 01:23 avro-1.6.3.jar
-rw-r--r-- 1 jboss jboss 232771 Jan 26 01:23 commons-codec-1.6.jar
-rw-r--r-- 1 jboss jboss 559366 Jan 26 01:23 commons-collections-3.1.jar
-rw-r--r-- 1 jboss jboss 163151 Jan 26 01:23 commons-io-2.1.jar
-rw-r--r-- 1 jboss jboss 284220 Jan 26 01:23 commons-lang-2.6.jar
-rw-r--r-- 1 jboss jboss 60686 Jan 26 01:23 commons-logging-1.1.1.jar
-rw-r--r-- 1 jboss jboss 313898 Jan 26 01:23 dom4j-1.6.1.jar
-rw-r--r-- 1 jboss jboss 934783 Jan 26 01:23 guava-r05.jar
-rw-r--r-- 1 jboss jboss 365546 Jan 26 01:23 hibernate-annotations-3.5.6-Final.jar
-rw-r--r-- 1 jboss jboss 71283 Jan 26 01:23 hibernate-commons-annotations-3.2.0.Final.jar
-rw-r--r-- 1 jboss jboss 81271 Jan 26 01:23 hibernate-commons-annotations-4.0.1.Final.jar
-rw-r--r-- 1 jboss jboss 2566731 Jan 26 01:23 hibernate-core-3.5.6-Final.jar
-rw-r--r-- 1 jboss jboss 479539 Jan 26 01:23 hibernate-entitymanager-4.1.9.Final.jar
-rw-r--r-- 1 jboss jboss 395572 Jan 26 01:23 hibernate-envers-4.1.9.Final.jar
-rw-r--r-- 1 jboss jboss 62411 Jan 26 01:23 hibernate-infinispan-4.1.9.Final.jar
-rw-r--r-- 1 jboss jboss 102661 Jan 26 01:23 hibernate-jpa-2.0-api-1.0.1.Final.jar
-rw-r--r-- 1 jboss jboss 2277 Jan 26 01:23 hibernate-search-4.2.0.Final.jar
-rw-r--r-- 1 jboss jboss 2421 Jan 26 01:23 hibernate-search-analyzers-4.2.0.Final.jar
-rw-r--r-- 1 jboss jboss 851161 Jan 26 01:23 hibernate-search-engine-4.2.0.Final.jar
-rw-r--r-- 1 jboss jboss 31909 Jan 26 01:23 hibernate-search-infinispan-4.2.0.Final.jar
-rw-r--r-- 1 jboss jboss 122458 Jan 26 01:23 hibernate-search-orm-4.2.0.Final.jar
-rw-r--r-- 1 jboss jboss 2419822 Jan 26 01:23 infinispan-core-5.2.0.Beta3.jar
-rw-r--r-- 1 jboss jboss 79215 Jan 26 01:23 infinispan-lucene-directory-5.1.8.Final.jar
-rw-r--r-- 1 jboss jboss 227500 Jan 26 01:23 jackson-core-asl-1.8.8.jar
-rw-r--r-- 1 jboss jboss 668564 Jan 26 01:23 jackson-mapper-asl-1.8.8.jar
-rw-r--r-- 1 jboss jboss 711972 Jan 26 01:23 javassist-3.17.1-GA.jar
-rw-r--r-- 1 jboss jboss 60768 Jan 26 01:23 jboss-logging-3.1.0.GA.jar
-rw-r--r-- 1 jboss jboss 229949 Jan 26 01:23 jboss-marshalling-1.3.15.GA.jar
-rw-r--r-- 1 jboss jboss 82089 Jan 26 01:23 jboss-marshalling-river-1.3.15.GA.jar
-rw-r--r-- 1 jboss jboss 11209 Jan 26 01:23 jboss-transaction-api_1.1_spec-1.0.0.Final.jar
-rw-r--r-- 1 jboss jboss 1982154 Jan 26 01:23 jgroups-3.2.0.CR1.jar
-rw-r--r-- 1 jboss jboss 570478 Jan 26 01:23 joda-time-2.1.jar
-rw-r--r-- 1 jboss jboss 15071 Jan 26 01:23 jta-1.1.jar
-rw-r--r-- 1 jboss jboss 489884 Jan 26 01:23 log4j-1.2.17.jar
-rw-r--r-- 1 jboss jboss 1173785 Jan 26 01:23 lucene-analyzers-3.6.2.jar
-rw-r--r-- 1 jboss jboss 1527069 Jan 26 01:23 lucene-analyzers-common-4.0.0.jar
-rw-r--r-- 1 jboss jboss 2038850 Jan 26 01:23 lucene-core-4.0.0.jar
-rw-r--r-- 1 jboss jboss 295662 Jan 26 01:23 lucene-facet-3.6.2.jar
-rw-r--r-- 1 jboss jboss 64006 Jan 26 01:23 lucene-grouping-3.6.2.jar
-rw-r--r-- 1 jboss jboss 89171 Jan 26 01:23 lucene-highlighter-3.6.2.jar
-rw-r--r-- 1 jboss jboss 4538090 Jan 26 01:23 lucene-kuromoji-3.6.2.jar
-rw-r--r-- 1 jboss jboss 29814 Jan 26 01:23 lucene-memory-3.6.2.jar
-rw-r--r-- 1 jboss jboss 65795 Jan 26 01:23 lucene-misc-3.6.2.jar
-rw-r--r-- 1 jboss jboss 15161 Jan 26 01:23 lucene-phonetic-3.6.2.jar
-rw-r--r-- 1 jboss jboss 3594565 Jan 26 01:23 lucene-smartcn-3.6.2.jar
-rw-r--r-- 1 jboss jboss 115257 Jan 26 01:23 lucene-snowball-3.0.3.jar
-rw-r--r-- 1 jboss jboss 60378 Jan 26 01:23 lucene-spatial-3.6.2.jar
-rw-r--r-- 1 jboss jboss 104823 Jan 26 01:23 lucene-spellchecker-3.6.2.jar
-rw-r--r-- 1 jboss jboss 511953 Jan 26 01:23 lucene-stempel-3.6.2.jar
-rw-r--r-- 1 jboss jboss 29555 Jan 26 01:23 paranamer-2.3.jar
-rw-r--r-- 1 jboss jboss 7616 Jan 26 01:23 rhq-pluginAnnotations-3.0.4.jar
-rw-r--r-- 1 jboss jboss 23445 Jan 26 01:23 slf4j-api-1.5.8.jar
-rw-r--r-- 1 jboss jboss 8819 Jan 26 01:23 slf4j-log4j12-1.7.2.jar
-rw-r--r-- 1 jboss jboss 995968 Jan 26 01:23 snappy-java-1.0.4.1.jar
-rw-r--r-- 1 jboss jboss 36474 Jan 26 01:23 solr-analysis-extras-3.6.2.jar
-rw-r--r-- 1 jboss jboss 1597254 Jan 26 01:23 solr-core-3.6.2.jar
-rw-r--r-- 1 jboss jboss 316359 Jan 26 01:23 solr-solrj-3.6.2.jar
-rw-r--r-- 1 jboss jboss 604742 Jan 26 01:23 spring-beans-3.2.0.RELEASE.jar
-rw-r--r-- 1 jboss jboss 863065 Jan 26 01:23 spring-core-3.2.0.RELEASE.jar
-rw-r--r-- 1 jboss jboss 400949 Jan 26 01:23 spring-jdbc-3.2.0.RELEASE.jar
-rw-r--r-- 1 jboss jboss 392189 Jan 26 01:23 spring-orm-3.2.0.RELEASE.jar
-rw-r--r-- 1 jboss jboss 240944 Jan 26 01:23 spring-tx-3.2.0.RELEASE.jar
-rw-r--r-- 1 jboss jboss 182112 Jan 26 01:23 stax2-api-3.1.1.jar
-rw-r--r-- 1 jboss jboss 36001 Jan 26 01:23 staxmapper-1.1.0.Final.jar
-rw-r--r-- 1 jboss jboss 478446 Jan 26 01:23 woodstox-core-asl-4.1.1.jar


pom.xml file:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
    <artifactId>ForestSurf</artifactId>
    <groupId>ForestSurf</groupId>
    <version>1.0</version>
  </parent>

    <groupId>ForestSurf</groupId>
    <artifactId>ForestSurf-ejb</artifactId>
    <version>1.0</version>
    <packaging>ejb</packaging>

    <name>ForestSurf-ejb</name>

    <properties>
        <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <log4j.version>1.2.14</log4j.version>
        <hibernate.version>4.1.7.Final</hibernate.version>
        <org.springframework-version>3.0.7.RELEASE</org.springframework-version>
    </properties>

    <dependencies>
<!--        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>4.1.9.Final</version>
            <scope>provided</scope>
        </dependency>-->
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-annotations</artifactId>
            <version>3.5.6-Final</version>
        </dependency>
        <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-infinispan</artifactId>
                <version>4.1.9.Final</version>
        </dependency>
        <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-entitymanager</artifactId>
                <version>4.1.9.Final</version>
        </dependency>

        <dependency>
                <groupId>org.hibernate.javax.persistence</groupId>
                <artifactId>hibernate-jpa-2.0-api</artifactId>
                <version>1.0.1.Final</version>
        </dependency>
               
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-search</artifactId>
            <version>4.2.0.Final</version>
        </dependency>
        <!-- Additional Analyzers: -->
        <dependency>
           <groupId>org.hibernate</groupId>
           <artifactId>hibernate-search-analyzers</artifactId>
           <version>4.2.0.Final</version>
        </dependency>
        <!-- Infinispan integration: -->
        <dependency>
           <groupId>org.hibernate</groupId>
           <artifactId>hibernate-search-infinispan</artifactId>
           <version>4.2.0.Final</version>
        </dependency>
        <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-search-orm</artifactId>
                <version>4.2.0.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-envers</artifactId>
            <version>4.1.9.Final</version>
           

            <exclusions>
                <exclusion>
                    <groupId>dom4j</groupId>
                    <artifactId>dom4j</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
            <version>3.2.0.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>6.0</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
                <groupId>org.apache.lucene</groupId>
                <artifactId>lucene-snowball</artifactId>
                <version>3.0.3</version>
        </dependency>
        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-core</artifactId>
            <version>4.0.0</version>
        </dependency>
       
        <dependency>
                <groupId>org.apache.lucene</groupId>
                <artifactId>lucene-analyzers-common</artifactId>
                <version>4.0.0</version>
        </dependency>
       
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.6</version>
        </dependency>
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <version>2.1</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.7.2</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.8.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                    <compilerArguments>
                        <endorseddirs>${endorsed.dir}</endorseddirs>
                    </compilerArguments>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-ejb-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <ejbVersion>3.1</ejbVersion>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.1</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${endorsed.dir}</outputDirectory>
                            <silent>true</silent>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>javax</groupId>
                                    <artifactId>javaee-endorsed-api</artifactId>
                                    <version>6.0</version>
                                    <type>jar</type>
                                </artifactItem>
<!--                                <artifactItem>
                                    <groupId>org.hibernate</groupId>
                                    <artifactId>hibernate-search</artifactId>
                                    <version>4.2.0.Final</version>
                                    <type>jar</type>
                                </artifactItem>-->
                            </artifactItems>
                        </configuration>
                    </execution>
                   
                </executions>
            </plugin>
        </plugins>
    </build>

</project>


Thank you for your time.
sam


Top
 Profile  
 
 Post subject: Re: DelegateNamedAnalyzer not found in Hibernate-search 4.2.0
PostPosted: Sat Jan 26, 2013 10:12 pm 
Regular
Regular

Joined: Fri Feb 04, 2011 8:34 pm
Posts: 66
I have created a test project for reproducing this problem.
Is there anyway I can post my sample project here? I can't find an upload file link in the post.

Database schema is shown as below:

Quote:
CREATE TABLE IF NOT EXISTS
myisam_product_article (
article_id int AUTO_INCREMENT,
a_desc text,
FULLTEXT(a_desc),
lat double,
lon double,
creation_date date,
primary key(article_id)
) engine=myisam;



DataSource configuration:

Quote:
<datasource jndi-name="java:jboss/datasources/HibernateSearchTest" pool-name="HibernateSearchTest" enabled="true" use-java-context="true">
<connection-url>jdbc:mysql://localhost:3306/hibernatedb</connection-url>
<driver>com.mysql</driver>
<transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
<pool>
<min-pool-size>10</min-pool-size>
<max-pool-size>100</max-pool-size>
<prefill>true</prefill>
</pool>
<security>
<user-name>myname</user-name>
<password>mypass</password>
</security>
</datasource>


Top
 Profile  
 
 Post subject: Re: DelegateNamedAnalyzer not found in Hibernate-search 4.2.0
PostPosted: Sun Jan 27, 2013 6:34 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
To anyone reading this: Samuel ended up sharing his test on JIRA
https://hibernate.onjira.com/browse/HSEARCH-1265

Where I explained how to manage dependencies on AS7 more effectively.

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


Top
 Profile  
 
 Post subject: Re: DelegateNamedAnalyzer not found in Hibernate-search 4.2.0
PostPosted: Sun Jan 27, 2013 7:55 am 
Regular
Regular

Joined: Fri Feb 04, 2011 8:34 pm
Posts: 66
sanne.grinovero wrote:
To anyone reading this: Samuel ended up sharing his test on JIRA
https://hibernate.onjira.com/browse/HSEARCH-1265

Where I explained how to manage dependencies on AS7 more effectively.

Hi Thank you very much for your prompt review of the issue.
I have followed your advise and removed the previous error.
After further remove the Lucene modules from the pom.xml and redeploy the module, jboss thrown another exception:

Quote:
22:51:20,963 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "HibernateSearchTest-ear-1.0.ear"
22:51:22,628 INFO [org.jboss.as.server.deployment] (MSC service thread 1-7) JBAS015876: Starting deployment of "HibernateSearchTest-ejb-1.0.jar"
22:51:22,628 INFO [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015876: Starting deployment of "HibernateSearchTest-web-1.0.war"
22:51:22,635 INFO [org.jboss.as.jpa] (MSC service thread 1-5) JBAS011401: Read persistence.xml for HibernateSeasrchTestPU
22:51:22,749 INFO [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-2) JNDI bindings for session bean named MyisamProductArticleFacade in deployment unit subdeployment "HibernateSearchTest-ejb-1.0.jar" of deployment "HibernateSearchTest-ear-1.0.ear" are as follows:

java:global/HibernateSearchTest-ear-1.0/HibernateSearchTest-ejb-1.0/MyisamProductArticleFacade!HibernateSearch.entity.facade.MyisamProductArticleFacadeLocal
java:app/HibernateSearchTest-ejb-1.0/MyisamProductArticleFacade!HibernateSearch.entity.facade.MyisamProductArticleFacadeLocal
java:module/MyisamProductArticleFacade!HibernateSearch.entity.facade.MyisamProductArticleFacadeLocal
java:global/HibernateSearchTest-ear-1.0/HibernateSearchTest-ejb-1.0/MyisamProductArticleFacade
java:app/HibernateSearchTest-ejb-1.0/MyisamProductArticleFacade
java:module/MyisamProductArticleFacade

22:51:22,765 INFO [org.jboss.as.jpa] (MSC service thread 1-7) JBAS011402: Starting Persistence Unit Service 'HibernateSearchTest-ear-1.0.ear/HibernateSearchTest-ejb-1.0.jar#HibernateSeasrchTestPU'
22:51:22,800 INFO [org.jboss.web] (MSC service thread 1-3) JBAS018210: Registering web context: /HibernateSearchTest-web
22:51:22,849 INFO [org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator] (MSC service thread 1-7) HHH000130: Instantiating explicit connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
22:51:22,855 INFO [org.hibernate.dialect.Dialect] (MSC service thread 1-7) HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
22:51:22,858 INFO [org.hibernate.engine.transaction.internal.TransactionFactoryInitiator] (MSC service thread 1-7) HHH000268: Transaction strategy: org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory
22:51:22,859 INFO [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] (MSC service thread 1-7) HHH000397: Using ASTQueryTranslatorFactory
22:51:22,880 INFO [org.hibernate.search.Version] (MSC service thread 1-7) HSEARCH000034: Hibernate Search 4.2.0.Final
22:51:22,893 WARN [org.hibernate.search.impl.ConfigContext] (MSC service thread 1-7) HSEARCH000075: Configuration setting hibernate.search.lucene_version was not specified, using LUCENE_CURRENT.
22:51:23,006 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC00001: Failed to start service jboss.persistenceunit."HibernateSearchTest-ear-1.0.ear/HibernateSearchTest-ejb-1.0.jar#HibernateSeasrchTestPU": org.jboss.msc.service.StartException in service jboss.persistenceunit."HibernateSearchTest-ear-1.0.ear/HibernateSearchTest-ejb-1.0.jar#HibernateSeasrchTestPU": Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) [rt.jar:1.6.0_07]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) [rt.jar:1.6.0_07]
at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_07]
Caused by: org.hibernate.search.SearchException: HSEARCH000159: Cannot find a Coordinates Interface nor Lat/Long annotations bound to default @Spatial for class HibernateSearch.entity.MyisamProductArticle
at org.hibernate.search.engine.spi.AbstractDocumentBuilder.bindSpatialAnnotation(AbstractDocumentBuilder.java:1038)
at org.hibernate.search.engine.spi.AbstractDocumentBuilder.initializeClassLevelAnnotations(AbstractDocumentBuilder.java:462)
at org.hibernate.search.engine.spi.AbstractDocumentBuilder.initializeClass(AbstractDocumentBuilder.java:376)
at org.hibernate.search.engine.spi.AbstractDocumentBuilder.<init>(AbstractDocumentBuilder.java:174)
at org.hibernate.search.engine.spi.DocumentBuilderIndexedEntity.<init>(DocumentBuilderIndexedEntity.java:179)
at org.hibernate.search.spi.SearchFactoryBuilder.initDocumentBuilders(SearchFactoryBuilder.java:422)
at org.hibernate.search.spi.SearchFactoryBuilder.buildNewSearchFactory(SearchFactoryBuilder.java:222)
at org.hibernate.search.spi.SearchFactoryBuilder.buildSearchFactory(SearchFactoryBuilder.java:146)
at org.hibernate.search.event.impl.FullTextIndexEventListener.initialize(FullTextIndexEventListener.java:130)
at org.hibernate.search.hcore.impl.HibernateSearchIntegrator.integrate(HibernateSearchIntegrator.java:83)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:303)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1750)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:94)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:905)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:890)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:74)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:162)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.start(PersistenceUnitServiceImpl.java:85)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
... 3 more

22:51:23,213 INFO [org.jboss.as.server] (DeploymentScanner-threads - 1) JBAS015870: Deploy of deployment "HibernateSearchTest-ear-1.0.ear" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.persistenceunit.\"HibernateSearchTest-ear-1.0.ear/HibernateSearchTest-ejb-1.0.jar#HibernateSeasrchTestPU\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"HibernateSearchTest-ear-1.0.ear/HibernateSearchTest-ejb-1.0.jar#HibernateSeasrchTestPU\": Failed to start service"}}
22:51:23,224 INFO [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015877: Stopped deployment HibernateSearchTest-ejb-1.0.jar in 11ms
22:51:23,225 INFO [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015877: Stopped deployment HibernateSearchTest-web-1.0.war in 11ms
22:51:23,249 INFO [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015877: Stopped deployment HibernateSearchTest-ear-1.0.ear in 36ms
22:51:23,250 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 1) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.persistenceunit."HibernateSearchTest-ear-1.0.ear/HibernateSearchTest-ejb-1.0.jar#HibernateSeasrchTestPU": org.jboss.msc.service.StartException in service jboss.persistenceunit."HibernateSearchTest-ear-1.0.ear/HibernateSearchTest-ejb-1.0.jar#HibernateSeasrchTestPU": Failed to start service

22:51:23,251 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 2) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014671: Failed services" => {"jboss.persistenceunit.\"HibernateSearchTest-ear-1.0.ear/HibernateSearchTest-ejb-1.0.jar#HibernateSeasrchTestPU\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"HibernateSearchTest-ear-1.0.ear/HibernateSearchTest-ejb-1.0.jar#HibernateSeasrchTestPU\": Failed to start service"}}}}


This is the entity class:

Code:
package HibernateSearch.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import org.apache.solr.analysis.LowerCaseFilterFactory;
import org.apache.solr.analysis.SnowballPorterFilterFactory;
import org.apache.solr.analysis.StandardTokenizerFactory;
import org.apache.solr.analysis.SynonymFilterFactory;
import org.hibernate.search.annotations.Analyzer;
import org.hibernate.search.annotations.AnalyzerDef;
import org.hibernate.search.annotations.Boost;
import org.hibernate.search.annotations.DateBridge;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Index;
import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.Latitude;
import org.hibernate.search.annotations.Longitude;
import org.hibernate.search.annotations.Parameter;
import org.hibernate.search.annotations.Resolution;
import org.hibernate.search.annotations.Spatial;
import org.hibernate.search.annotations.SpatialMode;
import org.hibernate.search.annotations.Store;
import org.hibernate.search.annotations.TokenFilterDef;
import org.hibernate.search.annotations.TokenizerDef;

/**
*
* @author sam
*/
@Entity
@Table(name = "myisam_product_article", catalog = "hibernatedb", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "MyisamProductArticle.findAll", query = "SELECT m FROM MyisamProductArticle m"),
    @NamedQuery(name = "MyisamProductArticle.findByArticleId", query = "SELECT m FROM MyisamProductArticle m WHERE m.articleId = :articleId"),
    @NamedQuery(name = "MyisamProductArticle.findByLat", query = "SELECT m FROM MyisamProductArticle m WHERE m.lat = :lat"),
    @NamedQuery(name = "MyisamProductArticle.findByLon", query = "SELECT m FROM MyisamProductArticle m WHERE m.lon = :lon"),
    @NamedQuery(name = "MyisamProductArticle.findByCreationDate", query = "SELECT m FROM MyisamProductArticle m WHERE m.creationDate = :creationDate")})

@Spatial(spatialMode = SpatialMode.GRID)
//This annotation tells hibernate search that this class has to be indexed
@Indexed(index = "MyisamProductArticle")
@Analyzer(impl = org.apache.lucene.analysis.standard.StandardAnalyzer.class)
@AnalyzerDef(name = "customanalyzer", tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class),
        filters = {@TokenFilterDef(factory = LowerCaseFilterFactory.class),
                    @TokenFilterDef(factory = SnowballPorterFilterFactory.class, params = {
                        @Parameter(name = "language", value = "English"),
                    }),
                    @TokenFilterDef(factory = SynonymFilterFactory.class, params = {
                        @Parameter(name = "ignoreCase", value = "true"),
                        @Parameter(name = "expand", value = "true"),
                        @Parameter(name = "synonyms", value="syntest.txt")})
                    })
public class MyisamProductArticle implements Serializable, Comparable<MyisamProductArticle> {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "article_id")
    private Integer articleId;
    @Lob
    @Size(max = 65535)
    @Column(name = "a_desc")
    @Analyzer(definition = "customanalyzer")
    @Field(index = Index.YES, store = Store.YES)
    private String aDesc;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "lat")
    @Latitude(of="location")
    private Double lat;
    @Column(name = "lon")
    @Longitude(of="location")
    private Double lon;
    @Column(name = "creation_date")
    @Temporal(TemporalType.DATE)
    private Date creationDate;

    public MyisamProductArticle() {
    }

    public MyisamProductArticle(Integer articleId) {
        this.articleId = articleId;
    }

    public Integer getArticleId() {
        return articleId;
    }

    public void setArticleId(Integer articleId) {
        this.articleId = articleId;
    }

    public String getADesc() {
        return aDesc;
    }

    public void setADesc(String aDesc) {
        this.aDesc = aDesc;
    }

    public Double getLat() {
        return lat;
    }

    public void setLat(Double lat) {
        this.lat = lat;
    }

    public Double getLon() {
        return lon;
    }

    public void setLon(Double lon) {
        this.lon = lon;
    }

    public Date getCreationDate() {
        return creationDate;
    }

    public void setCreationDate(Date creationDate) {
        this.creationDate = creationDate;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (articleId != null ? articleId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MyisamProductArticle)) {
            return false;
        }
        MyisamProductArticle other = (MyisamProductArticle) object;
        if ((this.articleId == null && other.articleId != null) || (this.articleId != null && !this.articleId.equals(other.articleId))) {
            return false;
        }
        return true;
    }

    // default comparator on Date
    @Override
    public int compareTo(MyisamProductArticle compareArticle) {
        //ascending order
        return this.creationDate.compareTo(compareArticle.creationDate);

        //descending order
        //return compareAritcle.compareTo(this.creationDate.creationDate);

   }
   
    @Override
    public String toString() {
        return "HibernateSearch.entity.MyisamProductArticle[ articleId=" + articleId + " ]";
    }
   
}


Thank you for your time again.
Samuel


Top
 Profile  
 
 Post subject: Re: DelegateNamedAnalyzer not found in Hibernate-search 4.2.0
PostPosted: Mon Jan 28, 2013 5:18 am 
Regular
Regular

Joined: Fri Feb 04, 2011 8:34 pm
Posts: 66
After added value="LUCENE_36" in the following persistence.xml file,

Code:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
  <persistence-unit name="HibernateSeasrchTestPU" transaction-type="JTA">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <jta-data-source>java:jboss/datasources/HibernateSearchTest</jta-data-source>
    <exclude-unlisted-classes>false</exclude-unlisted-classes>
    <properties>
      <property name="hibernate.hbm2ddl.auto" value="update"/>
      <property name="hibernate.show_sql" value="true"/>
      <property name="hibernate.format_sql" value="true"/>
      <property name="hibernate.max_fetch_depth" value="4"/>
      <property name="hibernate.default_batch_fetch_size" value="365"/>
       
      <property name="hibernate.search.default.directory_provider" value="filesystem"/>
      <property name="hibernate.search.default.indexBase" value="./lucene/indexes"/>
      <property name="hibernate.search.default.batch.merge_factor" value="10"/>
      <property name="hibernate.search.default.batch.max_buffered_docs" value="10"/>
      <property name="hibernate.search.lucene_version" value="LUCENE_36" />

    </properties>
  </persistence-unit>
</persistence>


redeploy the ear project, jboss thrown the following exception:

Quote:
19:55:09,446 INFO [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-2) JNDI bindings for session bean named MyisamProductArticleFacade in deployment unit subdeployment "HibernateSearchTest-ejb-1.0.jar" of deployment "HibernateSearchTest-ear-1.0.ear" are as follows:

java:global/HibernateSearchTest-ear-1.0/HibernateSearchTest-ejb-1.0/MyisamProductArticleFacade!HibernateSearch.entity.facade.MyisamProductArticleFacadeLocal
java:app/HibernateSearchTest-ejb-1.0/MyisamProductArticleFacade!HibernateSearch.entity.facade.MyisamProductArticleFacadeLocal
java:module/MyisamProductArticleFacade!HibernateSearch.entity.facade.MyisamProductArticleFacadeLocal
java:global/HibernateSearchTest-ear-1.0/HibernateSearchTest-ejb-1.0/MyisamProductArticleFacade
java:app/HibernateSearchTest-ejb-1.0/MyisamProductArticleFacade
java:module/MyisamProductArticleFacade

19:55:09,473 INFO [org.jboss.as.jpa] (MSC service thread 1-3) JBAS011402: Starting Persistence Unit Service 'HibernateSearchTest-ear-1.0.ear/HibernateSearchTest-ejb-1.0.jar#HibernateSeasrchTestPU'
19:55:09,554 INFO [org.jboss.web] (MSC service thread 1-4) JBAS018210: Registering web context: /HibernateSearchTest-web
19:55:09,624 INFO [org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator] (MSC service thread 1-3) HHH000130: Instantiating explicit connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
19:55:09,633 INFO [org.hibernate.dialect.Dialect] (MSC service thread 1-3) HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
19:55:09,637 INFO [org.hibernate.engine.transaction.internal.TransactionFactoryInitiator] (MSC service thread 1-3) HHH000268: Transaction strategy: org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory
19:55:09,640 INFO [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] (MSC service thread 1-3) HHH000397: Using ASTQueryTranslatorFactory
19:55:09,675 INFO [org.hibernate.search.Version] (MSC service thread 1-3) HSEARCH000034: Hibernate Search 4.2.0.Final
19:55:09,863 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC00001: Failed to start service jboss.persistenceunit."HibernateSearchTest-ear-1.0.ear/HibernateSearchTest-ejb-1.0.jar#HibernateSeasrchTestPU": org.jboss.msc.service.StartException in service jboss.persistenceunit."HibernateSearchTest-ear-1.0.ear/HibernateSearchTest-ejb-1.0.jar#HibernateSeasrchTestPU": Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) [rt.jar:1.6.0_07]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) [rt.jar:1.6.0_07]
at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_07]
Caused by: org.hibernate.search.SearchException: HSEARCH000159: Cannot find a Coordinates Interface nor Lat/Long annotations bound to default @Spatial for class HibernateSearch.entity.MyisamProductArticle
at org.hibernate.search.engine.spi.AbstractDocumentBuilder.bindSpatialAnnotation(AbstractDocumentBuilder.java:1038)
at org.hibernate.search.engine.spi.AbstractDocumentBuilder.initializeClassLevelAnnotations(AbstractDocumentBuilder.java:462)
at org.hibernate.search.engine.spi.AbstractDocumentBuilder.initializeClass(AbstractDocumentBuilder.java:376)
at org.hibernate.search.engine.spi.AbstractDocumentBuilder.<init>(AbstractDocumentBuilder.java:174)
at org.hibernate.search.engine.spi.DocumentBuilderIndexedEntity.<init>(DocumentBuilderIndexedEntity.java:179)
at org.hibernate.search.spi.SearchFactoryBuilder.initDocumentBuilders(SearchFactoryBuilder.java:422)
at org.hibernate.search.spi.SearchFactoryBuilder.buildNewSearchFactory(SearchFactoryBuilder.java:222)
at org.hibernate.search.spi.SearchFactoryBuilder.buildSearchFactory(SearchFactoryBuilder.java:146)
at org.hibernate.search.event.impl.FullTextIndexEventListener.initialize(FullTextIndexEventListener.java:130)
at org.hibernate.search.hcore.impl.HibernateSearchIntegrator.integrate(HibernateSearchIntegrator.java:83)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:303)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1750)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:94)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:905)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:890)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:74)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:162)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.start(PersistenceUnitServiceImpl.java:85)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]


Annotation on entity class:

Code:
@Column(name = "lat")
    @Latitude(of="location")
    private Double lat;
   
    @Column(name = "lon")
    @Longitude(of="location")
    private Double lon;

What other potential configuration error in my project?
Any suggestion is very appreciated.
Thanks
Sam


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.