NoSuchMethodError: ... addOnCompleteCallback

news/2024/7/3 14:38:11 标签: 大数据

问题描述:

  使用ES 2.3.1和Spark streaming 2.1时,出现以上报错信息。

原因:

addOnCompleteCallback方法在spark2.0中移除了

The addOnCompleteCallback method was removed from the TaskContext in Spark 2.0. Spark 2.0 is not binary compatible with previous releases. Because of this we only support Spark 2.0 in es-hadoop version 5.0 and later. Please upgrade to fix the issue.

解决方法:

  

<dependency>
      <groupId>org.elasticsearch</groupId>
        <artifactId>elasticsearch-spark_2.11</artifactId>
        <version>2.4.4</version>
 </dependency>

替换为
 <dependency> 
          <groupId>org.elasticsearch</groupId> 
          <artifactId>elasticsearch-hadoop</artifactId> 
          <version>5.1.2</version> 
</dependency> 

 参考:https://github.com/elastic/elasticsearch-hadoop/issues/905

转载于:https://www.cnblogs.com/bigbigtree/p/6757172.html


http://www.niftyadmin.cn/n/1791016.html

相关文章

PHP实现excel导出

2019独角兽企业重金招聘Python工程师标准>>> 1&#xff1a;前端代码 <div id‘export’>导出excel表单</div> // //导入excel文件 $("#export").on(click, function(){ $.ajax({ url:"importexcel.php&quo…

异常处理机制:两种方式

throws 异常类型 import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException;/*** author xianyu* version 1.0* date 2020/1/1 15:53*/ public class ExceptionTest2 {public static void main(String[] arg…

MapReduce之Reduce Join

一 介绍 Reduce Join其主要思想如下&#xff1a; 在map阶段&#xff0c;map函数同时读取两个文件File1和File2&#xff0c;为了区分两种来源的key/value数据对&#xff0c;对每条数据打一个标签&#xff08;tag&#xff09;&#xff0c; 比如&#xff1a;tag0表示来自文件File1…

Java的23种设计模式之单列设计模式

饿汉式单列模式类&#xff1a;在这个类每次加载到内存中就直接把instance实例化好了 package com.xianyu.singleton;/*** author xianyu* version 1.0* date 2020/3/12 16:35* 设计模式1: 单列设计模式*/ public class Program1 {public static void main(String[] args) {// …

vue-cli keep-alive用法以及activated,deactivated

keep-alive用法 <keep-alive>是Vue的内置组件&#xff0c;能在组件切换过程中将状态保留在内存中&#xff0c;防止重复渲染DOM。 include: 字符串或正则表达式。只有匹配的组件会被缓存。exclude: 字符串或正则表达式。任何匹配的组件都不会被缓存。import Vue from vue …

小型电子声光礼花器电子烟花爆竹电路设计

节日和庆典时燃放礼花&#xff0c;其绚丽缤纷的图案&#xff0c;热烈的爆炸声、欢乐的气氛&#xff0c;能给人们留下美好的印象&#xff0c;但有一定的烟尘污染和爆炸危险隐患。本电路可以模拟礼花燃放装置&#xff0c;达到声型兼备的效果&#xff0c;给人们在安全、环保的环境…

spring boot 配置 JPA

application.properties的配置 spring.datasource.platformpostgres spring.datasource.urljdbc:postgresql://localhost:5432/to_database spring.datasource.usernamepostgres spring.datasource.password123456789 spring.jpa.properties.hibernate.dialect org.hibernate.…

字节顺序

字节顺序 #include <stdio.h>typedef int* int_ptr; typedef unsigned char* byte_ptr;void show_bytes( byte_ptr start, int len ){int i;for( i 0; i < len; i ){printf( " %4.2x", start[i] );}printf( "\n" );}void show_int( int x ){show…