-->
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.  [ 5 posts ] 
Author Message
 Post subject: Problem defining custom analyzer
PostPosted: Sun Feb 15, 2009 8:44 am 
Beginner
Beginner

Joined: Tue Feb 03, 2009 12:29 pm
Posts: 49
I'm using the following versions.
Hibernate 3.3.1
Hibernate search 3.1
Hibernate annotations 3.4
Hibernate entitymanager 3.4

I added the following analyzer definition in my entity class.

@AnalyzerDef(name = "customanalyzer", tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class), filters = {
@TokenFilterDef(factory = ISOLatin1AccentFilterFactory.class),
@TokenFilterDef(factory = LowerCaseFilterFactory.class),
@TokenFilterDef(factory = StopFilterFactory.class, params = {
@Parameter(name = "words", value = "stoplist.properties"),
@Parameter(name = "ignoreCase", value = "true") }),
@TokenFilterDef(factory = SnowballPorterFilterFactory.class, params = { @Parameter(name = "language", value = "English") }),
@TokenFilterDef(factory = SynonymFilterFactory.class, params = { @Parameter(name = "synonyms", value = "synonyms.properties") })

})

When I attempt to index the entity, I get the following error. Am I missing something?

    Caused by: org.hibernate.HibernateException: could not init listeners
    at org.hibernate.event.EventListeners.initializeListeners(EventListeners.java:205)
    at org.hibernate.cfg.Configuration.getInitializedEventListeners(Configuration.java:1338)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
    at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
    at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
    ... 16 more
    Caused by: java.lang.ArrayStoreException
    at com.ibm.oti.reflect.AnnotationHelper.getReturnValueFromEntry(Native Method)
    at com.ibm.oti.reflect.AnnotationHelper.access$000(AnnotationHelper.java:14)
    at com.ibm.oti.reflect.AnnotationHelper$AnnotationInvocationHandler.invoke(AnnotationHelper.java:104)
    at $Proxy13.filters(Unknown Source)
    at org.hibernate.search.impl.SolrAnalyzerBuilder.buildAnalyzer(SolrAnalyzerBuilder.java:43)
    at org.hibernate.search.impl.InitContext.buildAnalyzer(InitContext.java:182)
    at org.hibernate.search.impl.InitContext.initLazyAnalyzers(InitContext.java:165)
    at org.hibernate.search.impl.SearchFactoryImpl.initDocumentBuilders(SearchFactoryImpl.java:431)
    at org.hibernate.search.impl.SearchFactoryImpl.<init>(SearchFactoryImpl.java:119)
    at org.hibernate.search.event.ContextHolder.getOrBuildSearchFactory(ContextHolder.java:30)
    at org.hibernate.search.event.FullTextIndexEventListener.initialize(FullTextIndexEventListener.java:59)
    at org.hibernate.event.EventListeners$1.processListener(EventListeners.java:198)
    at org.hibernate.event.EventListeners.processListeners(EventListeners.java:181)
    at org.hibernate.event.EventListeners.initializeListeners(EventListeners.java:194)
    ... 20 more


Top
 Profile  
 
 Post subject: Same error again
PostPosted: Sun Feb 15, 2009 9:58 am 
Beginner
Beginner

Joined: Tue Feb 03, 2009 12:29 pm
Posts: 49
I got the same exception stack trace when I used Fields annotation as shown below. Could it be some bug related to annotation processing? There is no problem with the single Field annotation though.

@Column(name = "COLOR")
@Fields( {
@Field(name = "color.clean", index = Index.TOKENIZED, store = org.hibernate.search.annotations.Store.YES, bridge = @FieldBridge(impl = ColorBridge.class)),
@Field(name = "color", index = Index.TOKENIZED, store = org.hibernate.search.annotations.Store.YES), })
private String color;

    Caused by: org.hibernate.HibernateException: could not init listeners
    at org.hibernate.event.EventListeners.initializeListeners(EventListeners.java:205)
    at org.hibernate.cfg.Configuration.getInitializedEventListeners(Configuration.java:1338)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
    at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
    at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
    ... 16 more
    Caused by: java.lang.ArrayStoreException
    at com.ibm.oti.reflect.AnnotationHelper.getReturnValueFromEntry(Native Method)
    at com.ibm.oti.reflect.AnnotationHelper.access$000(AnnotationHelper.java:14)
    at com.ibm.oti.reflect.AnnotationHelper$AnnotationInvocationHandler.invoke(AnnotationHelper.java:104)
    at $Proxy33.value(Unknown Source)
    at org.hibernate.search.engine.DocumentBuilderContainedEntity.checkForFields(DocumentBuilderContainedEntity.java:292)
    at org.hibernate.search.engine.DocumentBuilderContainedEntity.initializeMemberLevelAnnotations(DocumentBuilderContainedEntity.java:205)
    at org.hibernate.search.engine.DocumentBuilderContainedEntity.initializeClass(DocumentBuilderContainedEntity.java:146)
    at org.hibernate.search.engine.DocumentBuilderContainedEntity.init(DocumentBuilderContainedEntity.java:106)
    at org.hibernate.search.engine.DocumentBuilderIndexedEntity.init(DocumentBuilderIndexedEntity.java:147)
    at org.hibernate.search.engine.DocumentBuilderContainedEntity.<init>(DocumentBuilderContainedEntity.java:93)
    at org.hibernate.search.engine.DocumentBuilderIndexedEntity.<init>(DocumentBuilderIndexedEntity.java:128)
    at org.hibernate.search.impl.SearchFactoryImpl.initDocumentBuilders(SearchFactoryImpl.java:409)
    at org.hibernate.search.impl.SearchFactoryImpl.<init>(SearchFactoryImpl.java:119)
    at org.hibernate.search.event.ContextHolder.getOrBuildSearchFactory(ContextHolder.java:30)
    at org.hibernate.search.event.FullTextIndexEventListener.initialize(FullTextIndexEventListener.java:59)
    at org.hibernate.event.EventListeners$1.processListener(EventListeners.java:198)
    at org.hibernate.event.EventListeners.processListeners(EventListeners.java:181)
    at org.hibernate.event.EventListeners.initializeListeners(EventListeners.java:194)
    ... 20 more


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 15, 2009 10:58 am 
Beginner
Beginner

Joined: Tue Feb 03, 2009 12:29 pm
Posts: 49
I found that IBM JDK has a bug similar to this.

http://www.ibm.com/developerworks/forum ... &tstart=-1

Can someone in the Hibernate search team please confirm that this error is not because of any configuration errors from my part? Then I could request to my manager for a fix to be applied to our WAS installation.

Thanks,
Seema


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 16, 2009 6:01 am 
Hibernate Team
Hibernate Team

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

I think you are onto something here. It seems to be the same problem experienced at this post - http://forum.hibernate.org/viewtopic.php?t=992936
Again, the mapping looks fine and the mentioned IBM JDK bug seems to me a good candidate for the problem.

A good test for this theory is to switch to a Sun JDK to see if the problems disappears. Not sure if this is possible for you.

In case you are going to apply a patch let us know the outcome. It seems other people are experiencing the same problem.

Thanks.

--Hardy


Top
 Profile  
 
 Post subject: Patch
PostPosted: Fri Feb 20, 2009 1:38 am 
Beginner
Beginner

Joined: Tue Feb 03, 2009 12:29 pm
Posts: 49
Hardy,
I have asked for the fix to be applied to the IBM JRE. The link for it seems to be this.
http://www-01.ibm.com/support/docview.w ... wg24014149

I will update once this is done and is found working.

Thanks,
Seema


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