我将Web应用程序打包为war,并且正在使用6.X Elasticsearch Java Client连接到EalsticSearch。我正在将其部署在Weblogic服务器上。每次我打电话给client.search(request)时,下面的代码
client = provider.createClient();
SearchRequest request = new SearchRequest("persondata");
SearchSourceBuilder sourceBuilder = new SearchSourceBuilder();
sourceBuilder.query(QueryBuilders.termQuery("name", "Shubham"));
sourceBuilder.from(0);
sourceBuilder.size(5);
sourceBuilder.timeout(new TimeValue(60, TimeUnit.SECONDS));
request.source(sourceBuilder);
getResponse = client.search(request);
尽管我有最新的杰克逊依赖关系,但还是遇到了以下异常。
ServletException的根本原因。 org.glassfish.jersey.server.ContainerException:java.lang.NoSuchFieldError:FAIL_ON_SYMBOL_HASH_OVERFLOW 在org.glassfish.jersey.servlet.internal.ResponseWriter.rethrow(ResponseWriter.java:256) 在org.glassfish.jersey.servlet.internal.ResponseWriter.failure(ResponseWriter.java:238) 在org.glassfish.jersey.server.ServerRuntime $ Responder.process(ServerRuntime.java:486) 在org.glassfish.jersey.server.ServerRuntime $ 2.run(ServerRuntime.java:317) 在org.glassfish.jersey.internal.Errors $ 1.call(Errors.java:271) 被截断了。请参阅日志文件以获取完整的stacktrace 原因:java.lang.NoSuchFieldError:FAIL_ON_SYMBOL_HASH_OVERFLOW 在org.elasticsearch.common.xcontent.json.JsonXContent。(JsonXContent.java:57) 在org.elasticsearch.common.xcontent.XContentType $ 1.xContent(XContentType.java:60) 在org.elasticsearch.common.xcontent.XContentHelper.toXContent(XContentHelper.java:461) 在org.elasticsearch.common.xcontent.XContentHelper.toXContent(XContentHelper.java:452) 在org.elasticsearch.client.Request.createEntity(Request.java:373) 被截断了。请参阅日志文件以获取完整的stacktrace
我的pom文件如下所示
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>de.iteos.reporting</groupId>
<artifactId>auslaender-reporting</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>auslaender-reporting-elasticsearch</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<jee.version>7.0</jee.version>
<servlet.version>3.1.0</servlet.version>
<elasticsearch.version>6.0.1</elasticsearch.version>
<jackson.version>2.9.4</jackson.version>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>6.0.1</version>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-high-level-client</artifactId>
<version>6.0.1</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.9.4</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.4</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.9.4</version>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
</dependency>
</dependencies>
我正在使用Weblogic 12.2.1 这里缺少什么,任何人都可以迅速帮助我。
谢谢。