-->
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: Exception: Hibernate Search sync consumer thread for index
PostPosted: Tue Mar 07, 2017 10:41 pm 
Newbie

Joined: Tue Mar 07, 2017 10:28 pm
Posts: 5
when I index some object there propertie is object,throw this exception,please tell me the solution,thank you verymuch

Entity:

@Entity(name = "t_car")
@Indexed
public class Car {

@Id
@DocumentId
private Integer id;
@Field(index = Index.YES, analyze = Analyze.YES, store = Store.YES)
private String name;//车型名
@Field(index = Index.YES, analyze = Analyze.YES, store = Store.YES)
private String type;//类型
private String image;

@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
@JoinColumn(name = "brand_id")
@IndexedEmbedded
private Brand brand;//品牌

@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinTable(name = "t_c_s",
joinColumns = { @JoinColumn(name = "c_id")},
inverseJoinColumns = { @JoinColumn(name = "s_id")})
@IndexedEmbedded
private Set<Source> sources;//来源
@OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL, mappedBy = "car")
@IndexedEmbedded
private Set<SaleInfo> saleInfos;//配置(商户发布售车资讯)
@OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL, mappedBy = "car")
@IndexedEmbedded
private Set<FindInfo> findInfos;//寻车(用户发布寻车资讯)
//setter and getter
}
@Entity(name = "t_brand")
@Indexed
public class Brand {

@Id
@DocumentId
private Integer id;
@Field(index = Index.YES, analyze = Analyze.YES, store = Store.YES)
private String name;
private String image;

@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "brand")
@ContainedIn
private Set<Car> cars;
//setter and getter
}

config:

hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
hibernate.hbm2ddl.auto = none
hibernate.show_sql = true
hibernate.format_sql = true
hibernate.search.default.directory_provider = filesystem
hibernate.search.default.indexBase = e:/index
hibernate.search.analyzer = org.wltea.analyzer.lucene.IKAnalyzer

when I index car
Exception:

Exception in thread "Hibernate Search sync consumer thread for index com.entity.Car" java.lang.AbstractMethodError
at org.apache.lucene.analysis.AnalyzerWrapper.createComponents(AnalyzerWrapper.java:101)
at org.apache.lucene.analysis.AnalyzerWrapper.createComponents(AnalyzerWrapper.java:101)
at org.apache.lucene.analysis.Analyzer.tokenStream(Analyzer.java:176)
at org.apache.lucene.document.Field.tokenStream(Field.java:562)
at org.apache.lucene.index.DefaultIndexingChain$PerField.invert(DefaultIndexingChain.java:607)
at org.apache.lucene.index.DefaultIndexingChain.processField(DefaultIndexingChain.java:344)
at org.apache.lucene.index.DefaultIndexingChain.processDocument(DefaultIndexingChain.java:300)
at org.apache.lucene.index.DocumentsWriterPerThread.updateDocument(DocumentsWriterPerThread.java:234)
at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:450)
at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:1477)
at org.hibernate.search.backend.impl.lucene.IndexWriterDelegate.updateDocument(IndexWriterDelegate.java:74)
at org.hibernate.search.backend.impl.lucene.works.UpdateExtWorkExecutor.performWork(UpdateExtWorkExecutor.java:71)
at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.performWork(LuceneBackendQueueTask.java:110)
at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.applyUpdates(LuceneBackendQueueTask.java:91)
at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.run(LuceneBackendQueueTask.java:46)
at org.hibernate.search.backend.impl.lucene.SyncWorkProcessor$Consumer.applyChangesets(SyncWorkProcessor.java:158)
at org.hibernate.search.backend.impl.lucene.SyncWorkProcessor$Consumer.run(SyncWorkProcessor.java:147)
at java.lang.Thread.run(Thread.java:722)


Thank you.


Top
 Profile  
 
 Post subject: Re: Exception: Hibernate Search sync consumer thread for index
PostPosted: Wed Mar 08, 2017 6:04 am 
Newbie

Joined: Tue Mar 07, 2017 10:28 pm
Posts: 5
Now that has solved this problem, the solution is to use the IKAnalyzer,But I need to use the IKAnalyzer


Top
 Profile  
 
 Post subject: Re: Exception: Hibernate Search sync consumer thread for index
PostPosted: Wed Mar 08, 2017 8:03 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,

when you see an "AbstractMethodError" exception you are likely using the wrong version of some dependency.

Make sure all your Analyzers are built for the same version of Apache Lucene as the Lucene version being used by Hibernate Search.

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


Top
 Profile  
 
 Post subject: Re: Exception: Hibernate Search sync consumer thread for index
PostPosted: Wed Mar 08, 2017 9:47 pm 
Newbie

Joined: Tue Mar 07, 2017 10:28 pm
Posts: 5
sanne.grinovero wrote:
Hi,

when you see an "AbstractMethodError" exception you are likely using the wrong version of some dependency.

Make sure all your Analyzers are built for the same version of Apache Lucene as the Lucene version being used by Hibernate Search.


Sorry,I was wrong before. The solution is not use IKAnalyzer,but I need IKAnalyzer.

This is my pom.xml

<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>Car</groupId>
<artifactId>ParallerCar</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>ParallerCar Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>4.3.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>4.3.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>4.3.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>4.3.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>4.3.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>4.3.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.3.3.RELEASE</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>4.3.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.3.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.3.3.RELEASE</version>
</dependency>

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.1.0.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.4.0.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>5.1.0.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>5.1.0.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
<version>1.0.0.Final</version>
</dependency>

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search-orm</artifactId>
<version>5.6.0.Alpha1</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search-engine</artifactId>
<version>5.6.0.Alpha1</version>
</dependency>

<dependency>
<groupId>com.janeluo</groupId>
<artifactId>ikanalyzer</artifactId>
<version>2012_u6</version>
</dependency>

<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.38</version>
</dependency>

<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.0.18</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>


</dependencies>
<build>
<finalName>ParallerCar</finalName>
</build>
</project>


Top
 Profile  
 
 Post subject: Re: Exception: Hibernate Search sync consumer thread for index
PostPosted: Wed Mar 08, 2017 9:53 pm 
Newbie

Joined: Tue Mar 07, 2017 10:28 pm
Posts: 5
sanne.grinovero wrote:
Hi,

when you see an "AbstractMethodError" exception you are likely using the wrong version of some dependency.

Make sure all your Analyzers are built for the same version of Apache Lucene as the Lucene version being used by Hibernate Search.


This is my jar

Maven: antlr:antlr:2.7.7
Maven: com.alibaba:druid:1.0.18
Maven: com.alibaba:jconsole:1.8.0
Maven: com.alibaba:tools:1.8.0
Maven: com.fasterxml:classmate:1.3.0
Maven: com.janeluo:ikanalyzer:2012_u6
Maven: commons-logging:commons-logging:1.2
Maven: dom4j:dom4j:1.6.1
Maven: javax.validation:validation-api:1.1.0.Final
Maven: junit:junit:4.12
Maven: mysql:mysql-connector-java:5.1.38
Maven: org.apache.geronimo.specs:geronimo-jta_1.1_spec:1.1.1
Maven: org.apache.lucene:lucene-analyzers-common:5.4.1
Maven: org.apache.lucene:lucene-backward-codecs:5.4.1
Maven: org.apache.lucene:lucene-core:5.4.1
Maven: org.apache.lucene:lucene-facet:5.4.1
Maven: org.apache.lucene:lucene-misc:5.4.1
Maven: org.apache.lucene:lucene-queries:5.4.1
Maven: org.apache.lucene:lucene-queryparser:4.7.2
Maven: org.apache.lucene:lucene-sandbox:4.7.2
Maven: org.aspectj:aspectjweaver:1.8.9
Maven: org.hamcrest:hamcrest-core:1.3
Maven: org.hibernate.common:hibernate-commons-annotations:5.0.1.Final
Maven: org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
Maven: org.hibernate:hibernate-annotations:3.4.0.GA
Maven: org.hibernate:hibernate-commons-annotations:3.1.0.GA
Maven: org.hibernate:hibernate-core:5.1.0.Final
Maven: org.hibernate:hibernate-entitymanager:5.1.0.Final
Maven: org.hibernate:hibernate-search-engine:5.6.0.Alpha1
Maven: org.hibernate:hibernate-search-orm:5.6.0.Alpha1
Maven: org.hibernate:hibernate-validator:5.1.0.Final
Maven: org.javassist:javassist:3.20.0-GA
Maven: org.jboss.logging:jboss-logging:3.3.0.Final
Maven: org.jboss:jandex:2.0.0.Final
Maven: org.slf4j:slf4j-api:1.4.2
Maven: org.springframework:spring-aop:4.3.3.RELEASE
Maven: org.springframework:spring-aspects:4.3.3.RELEASE
Maven: org.springframework:spring-beans:4.3.3.RELEASE
Maven: org.springframework:spring-context:4.3.3.RELEASE
Maven: org.springframework:spring-context-support:4.3.3.RELEASE
Maven: org.springframework:spring-core:4.3.3.RELEASE
Maven: org.springframework:spring-expression:4.3.3.RELEASE
Maven: org.springframework:spring-jdbc:4.3.3.RELEASE
Maven: org.springframework:spring-orm:4.3.3.RELEASE
Maven: org.springframework:spring-tx:4.3.3.RELEASE
Maven: org.springframework:spring-web:4.3.3.RELEASE
Maven: org.springframework:spring-webmvc:4.3.3.RELEASE
Maven: xml-apis:xml-apis:1.0.b2


Top
 Profile  
 
 Post subject: Re: Exception: Hibernate Search sync consumer thread for index
PostPosted: Thu Mar 09, 2017 1:05 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Quote:
Maven: org.apache.lucene:lucene-analyzers-common:5.4.1
Maven: org.apache.lucene:lucene-backward-codecs:5.4.1
Maven: org.apache.lucene:lucene-core:5.4.1
Maven: org.apache.lucene:lucene-facet:5.4.1
Maven: org.apache.lucene:lucene-misc:5.4.1
Maven: org.apache.lucene:lucene-queries:5.4.1
Maven: org.apache.lucene:lucene-queryparser:4.7.2
Maven: org.apache.lucene:lucene-sandbox:4.7.2


Those Apache Lucene libraries need to be all at the same version.

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


Top
 Profile  
 
 Post subject: Re: Exception: Hibernate Search sync consumer thread for index
PostPosted: Thu Mar 09, 2017 10:06 pm 
Newbie

Joined: Tue Mar 07, 2017 10:28 pm
Posts: 5
sanne.grinovero wrote:
Quote:
Maven: org.apache.lucene:lucene-analyzers-common:5.4.1
Maven: org.apache.lucene:lucene-backward-codecs:5.4.1
Maven: org.apache.lucene:lucene-core:5.4.1
Maven: org.apache.lucene:lucene-facet:5.4.1
Maven: org.apache.lucene:lucene-misc:5.4.1
Maven: org.apache.lucene:lucene-queries:5.4.1
Maven: org.apache.lucene:lucene-queryparser:4.7.2
Maven: org.apache.lucene:lucene-sandbox:4.7.2


Those Apache Lucene libraries need to be all at the same version.


This is maven automatically downloaded,but I changed the pom.xml file will still appear that exception.
This is jar

Maven: antlr:antlr:2.7.7
Maven: com.alibaba:druid:1.0.18
Maven: com.alibaba:jconsole:1.8.0
Maven: com.alibaba:tools:1.8.0
Maven: com.fasterxml:classmate:1.3.0
Maven: com.janeluo:ikanalyzer:2012_u6
Maven: commons-logging:commons-logging:1.2
Maven: dom4j:dom4j:1.6.1
Maven: jakarta-regexp:jakarta-regexp:1.4
Maven: javax.validation:validation-api:1.1.0.Final
Maven: junit:junit:4.12
Maven: log4j:log4j:1.2.17
Maven: mysql:mysql-connector-java:5.1.38
Maven: org.apache.geronimo.specs:geronimo-jta_1.1_spec:1.1.1
Maven: org.apache.lucene:lucene-analyzers-common:5.5.2
Maven: org.apache.lucene:lucene-core:5.5.2
Maven: org.apache.lucene:lucene-facet:5.5.2
Maven: org.apache.lucene:lucene-misc:5.5.2
Maven: org.apache.lucene:lucene-queries:5.5.2
Maven: org.apache.lucene:lucene-queryparser:5.5.2
Maven: org.apache.lucene:lucene-sandbox:5.5.2
Maven: org.apache.lucene:lucene-spatial:5.5.2
Maven: org.aspectj:aspectjweaver:1.8.9
Maven: org.hamcrest:hamcrest-core:1.3
Maven: org.hibernate.common:hibernate-commons-annotations:5.0.1.Final
Maven: org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
Maven: org.hibernate:hibernate-core:5.1.0.Final
Maven: org.hibernate:hibernate-entitymanager:5.1.0.Final
Maven: org.hibernate:hibernate-search-engine:5.6.0.Final
Maven: org.hibernate:hibernate-search-orm:5.6.0.Final
Maven: org.hibernate:hibernate-validator:5.1.0.Final
Maven: org.javassist:javassist:3.20.0-GA
Maven: org.jboss.logging:jboss-logging:3.3.0.Final
Maven: org.jboss:jandex:2.0.0.Final
Maven: org.slf4j:slf4j-api:1.7.21
Maven: org.springframework:spring-aop:4.3.3.RELEASE
Maven: org.springframework:spring-aspects:4.3.3.RELEASE
Maven: org.springframework:spring-beans:4.3.3.RELEASE
Maven: org.springframework:spring-context:4.3.3.RELEASE
Maven: org.springframework:spring-context-support:4.3.3.RELEASE
Maven: org.springframework:spring-core:4.3.3.RELEASE
Maven: org.springframework:spring-expression:4.3.3.RELEASE
Maven: org.springframework:spring-jdbc:4.3.3.RELEASE
Maven: org.springframework:spring-orm:4.3.3.RELEASE
Maven: org.springframework:spring-tx:4.3.3.RELEASE
Maven: org.springframework:spring-web:4.3.3.RELEASE
Maven: org.springframework:spring-webmvc:4.3.3.RELEASE
Maven: xml-apis:xml-apis:1.0.b2

This is Exception:

Exception in thread "Hibernate Search sync consumer thread for index com.entity.Car" java.lang.AbstractMethodError
at org.apache.lucene.analysis.AnalyzerWrapper.createComponents(AnalyzerWrapper.java:101)
at org.apache.lucene.analysis.AnalyzerWrapper.createComponents(AnalyzerWrapper.java:101)
at org.apache.lucene.analysis.Analyzer.tokenStream(Analyzer.java:176)
at org.apache.lucene.document.Field.tokenStream(Field.java:562)
at org.apache.lucene.index.DefaultIndexingChain$PerField.invert(DefaultIndexingChain.java:628)
at org.apache.lucene.index.DefaultIndexingChain.processField(DefaultIndexingChain.java:365)
at org.apache.lucene.index.DefaultIndexingChain.processDocument(DefaultIndexingChain.java:321)
at org.apache.lucene.index.DocumentsWriterPerThread.updateDocument(DocumentsWriterPerThread.java:234)
at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:450)
at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:1477)
at org.hibernate.search.backend.impl.lucene.IndexWriterDelegate.updateDocument(IndexWriterDelegate.java:77)
at org.hibernate.search.backend.impl.lucene.works.UpdateExtWorkExecutor.performWork(UpdateExtWorkExecutor.java:71)
at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.performWork(LuceneBackendQueueTask.java:112)
at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.applyUpdates(LuceneBackendQueueTask.java:92)
at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.run(LuceneBackendQueueTask.java:46)
at org.hibernate.search.backend.impl.lucene.SyncWorkProcessor$Consumer.applyChangesets(SyncWorkProcessor.java:165)
at org.hibernate.search.backend.impl.lucene.SyncWorkProcessor$Consumer.run(SyncWorkProcessor.java:151)
at java.lang.Thread.run(Thread.java:722)

But now I am not using IKAnalyzer for the time being okay,I need to know how to build a cluster,I have been studying for two weeks, but the cluster is still unable to start

At the same time I would also like to ask you about the cluster

I will understand the need to configure JMS or JGroup back-end, but I do not know how to configure, and now I already know that you can use ActiveMQ to solve the JMS queue, but I do not Know how to use, i just want to build a very simple cluster, can you help me?

I only knew about the cluster,I do not know how they communicate, how to connect them
hibernate.search.default.directory_provider = filesystem-slave
hibernate.search.default.sourceBase = / mnt / mastervolume / lucenedirs / mastercopy
hibernate.search.default.indexBase = / Users / prod / lucenedirs
hibernate.search.default.refresh = 1800
hibernate.search.default.worker.backend = jms
hibernate.search.default.worker.jms.connection_factory = / ConnectionFactory
hibernate.search.default.worker.jms.queue = queue / hibernatesearch
hibernate.search.default.worker.jms.login = myname
hibernate.search.default.worker.jms.password = wonttellyou
hibernate.search.worker.enlist_in_transaction = true


Now some simple inquiries, many inquiries and index I have been resolved, and now the cluster is one of my goals, I put stackoverflow all the hibernate search on the Q & A are seen, but did not see. I also search in the search engine, but there is no detailed explanation on the hibernate search cluster, just mention hibernate search support cluster only. I also downloaded the code in GitHub, but no way to start,Would you assist me? Just a very simple example just fine.

Thank you very very much


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.