0
개념 증명 Java 코드가 작동하려고합니다. 내가하려고하는 첫 번째 일은 내 HD에서 일부 txt 문서의 색인입니다. 그러나 노드를 만들려고 할 때 예외가 발생하기 전에는 그다지 익숙하지 않습니다.탄성 검색 - Java에서 노드/인덱스를 생성 할 때 오류가 발생했습니다.
모두 아래의 예외 발생 다음 코드 :
코드
Node node = nodeBuilder().node(); Client client = node.client();
내 주요 질문
가입니다 :내가없는 것으로 보인다 BoundaryScanner 클래스를 얻을 수 있습니다 ? 나는 예외적으로 아래에 pom.xml을 제공 할 것입니다. lucene-fast-vector-highlighter 패키지는 최신 버전 3.0.3 인 것 같습니다.
도움을 주시면 감사하겠습니다.
예외
07-Jun-2012 12:44:00 org.elasticsearch.node
INFO: [Allatou] {0.19.4}[2648]: initializing ...
07-Jun-2012 12:44:00 org.elasticsearch.plugins
INFO: [Allatou] loaded [], sites []
Exception in thread "main" org.elasticsearch.common.collect.ComputationException: java.lang.NoClassDefFoundError: org/apache/lucene/search/vectorhighlight/BoundaryScanner
at org.elasticsearch.common.collect.ComputingConcurrentHashMap$ComputingMapAdapter.get(ComputingConcurrentHashMap.java:400)
at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:49)
at org.elasticsearch.common.inject.ConstructorInjectorStore.get(ConstructorInjectorStore.java:50)
at org.elasticsearch.common.inject.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:50)
at org.elasticsearch.common.inject.InjectorImpl.initializeBinding(InjectorImpl.java:370)
at org.elasticsearch.common.inject.BindingProcessor$1$1.run(BindingProcessor.java:148)
at org.elasticsearch.common.inject.BindingProcessor.initializeBindings(BindingProcessor.java:204)
at org.elasticsearch.common.inject.InjectorBuilder.initializeStatically(InjectorBuilder.java:119)
at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:102)
at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:93)
at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:70)
at org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:59)
at org.elasticsearch.node.internal.InternalNode.<init>(InternalNode.java:149)
at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)
at org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:166)
at ie.openmobile.elasticsearch.Main.main(Main.java:49)
Caused by: java.lang.NoClassDefFoundError: org/apache/lucene/search/vectorhighlight/BoundaryScanner
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getDeclaredConstructors(Unknown Source)
at org.elasticsearch.common.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:177)
at org.elasticsearch.common.inject.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:59)
at org.elasticsearch.common.inject.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:29)
at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:37)
at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:33)
at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:38)
at org.elasticsearch.common.collect.ComputingConcurrentHashMap$ComputingValueReference.compute(ComputingConcurrentHashMap.java:358)
at org.elasticsearch.common.collect.ComputingConcurrentHashMap$ComputingSegment.compute(ComputingConcurrentHashMap.java:184)
at org.elasticsearch.common.collect.ComputingConcurrentHashMap$ComputingSegment.getOrCompute(ComputingConcurrentHashMap.java:153)
at org.elasticsearch.common.collect.ComputingConcurrentHashMap.getOrCompute(ComputingConcurrentHashMap.java:69)
at org.elasticsearch.common.collect.ComputingConcurrentHashMap$ComputingMapAdapter.get(ComputingConcurrentHashMap.java:396)
... 15 more
Caused by: java.lang.ClassNotFoundException: org.apache.lucene.search.vectorhighlight.BoundaryScanner
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 29 more
의 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.examplegroup</groupId>
<artifactId>artifacename</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>elasticsearch</name>
<url>http://maven.apache.org</url>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
<configuration>
<systemPropertyVariables>
<user.region>uk</user.region>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<!-- elasticsearch hosted here -->
<id>sonatype-releases</id>
<name>Sonatype Releases Repository</name>
<url>http://oss.sonatype.org/content/repositories/releases/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<!-- jsoup HTML parser library @ http://jsoup.org/ -->
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.6.3</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-core</artifactId>
<version>3.6.0</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-analyzers</artifactId>
<version>3.6.0</version>
</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-fast-vector-highlighter</artifactId>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-highlighter</artifactId>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-queries</artifactId>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>0.19.4</version>
</dependency>
</dependencies>
</project>
감사 imotov을 : 당신이 루씬 - 눈덩이 유물을 필요가 없습니다, 그리고 루씬 빠른 벡터 - 하이 라이터는 루씬 - 하이 라이터 지금, 그래서 예를 들어, 눈덩이 분석기, 루씬-분석기에서 지금이다. 나는 대답을 올릴 때 똑같은 것을 쓰고 있었다. 특히 java.lang.NoClassDefFoundError는 문제가 2.4.0 인 lucene-highlighter 패키지를 참조했습니다. 그것 (그리고 그 밖의 모든 것들)이 3.6.0으로 업데이트되면 잘 돌아갑니다. 시간과 노력에 감사드립니다. 아, 새로운 유물에 대한 추가 정보를 주셔서 감사합니다. – feargal