Open
why633630
opened this issue 10 years ago
•
9 comments
用1.2.5和es2.3.4集成后,插入es数据和测试es分词效果时报如下错误:
{
"error" : {
"root_cause" : [ {
"type" : "no_class_def_found_error",
"reason" : "no_class_def_found_error: Could not initialize class com.hankcs.hanlp.seg.common.Vertex"
} ],
"type" : "no_class_def_found_error",
"reason" : "no_class_def_found_error: Could not initialize class com.hankcs.hanlp.seg.common.Vertex"
},
"status" : 500
}
堆栈为:
Caused by: NotSerializableExceptionWrapper[no_class_def_found_error: Could not initialize class com.hankcs.hanlp.seg.common.Vertex]
at com.hankcs.hanlp.seg.common.WordNet.(WordNet.java:71)
at com.hankcs.hanlp.seg.Viterbi.ViterbiSegment.segSentence(ViterbiSegment.java:40)
at com.hankcs.hanlp.seg.Segment.seg(Segment.java:422)
at com.hankcs.hanlp.seg.common.wrapper.SegmentWrapper.next(SegmentWrapper.java:62)
at com.hylanda.hanlp.plugin.HanlpTokenizer.incrementToken(HanlpTokenizer.java:101)
at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction.simpleAnalyze(TransportAnalyzeAction.java:247)
at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction.shardOperation(TransportAnalyzeAction.java:225)
at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction.shardOperation(TransportAnalyzeAction.java:63)
at org.elasticsearch.action.support.single.shard.TransportSingleShardAction$ShardTransportHandler.messageReceived(TransportSingleShardAction.java:282)
at org.elasticsearch.action.support.single.shard.TransportSingleShardAction$ShardTransportHandler.messageReceived(TransportSingleShardAction.java:275)
at org.elasticsearch.transport.TransportRequestHandler.messageReceived(TransportRequestHandler.java:33)
at org.elasticsearch.transport.RequestHandlerRegistry.processMessageReceived(RequestHandlerRegistry.java:75)
at org.elasticsearch.transport.netty.MessageChannelHandler$RequestHandler.doRun(MessageChannelHandler.java:300)
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
请问Vertex这个类初始化的时候是不是有操作文件的代码?我怀疑是权限问题
public static Vertex B = new Vertex(Predefine.TAG_BIGIN, " ", new CoreDictionary.Attribute(Nature.begin, Predefine.MAX_FREQUENCY / 10), CoreDictionary.getWordID(Predefine.TAG_BIGIN));