HBase查询报错:java.lang.NoClassDefFoundError:org.apache.hadoop.hbase.util.ByteStringer

Spark读写HBase实践 Spark经常会读写一些外部数据源,常见的有HDFS、HBase、JDBC、Redis、Kafka等。这些都是Spark的常见操作,做一个简单的Demo总结,方便后续开发查阅。 1.1 maven依赖 需要引入Hadoop和HBase的相关依赖,版本信息根据实际情况确定。 <properties> <hadoop.version>2.6.0-cdh5.7.... 阅读详情

环境信息:

Hadoop 2.7.2+HBase 1.2.2

现象:

下午前端的同事使用scan查询HBase数据,代码执行到Table.getScanner(scan)方法时卡住了,无法返回结果直到超时,查看控制台,出现如下报错:java.lang.NoClassDefFoundError:org.apache.hadoop.hbase.util.ByteStringer

问题分析:

常规操作,这种情况下是因为jar包缺失或者jar包有问题造成的,但是一般情况下这种错误的概率比较小,毕竟有maven在,所以象征性的验证下hbase-protocol-1.2.2.jar是否存在,不出所料,果然在....

思索下,是不是缓存或者项目编译的问题?使用maven更新了下依赖顺带着重新编译了,再次触发查询,同样的问题,问题未解决....

虽然问题未解决,直觉应该还是maven引用的问题,回头继续排查pom文件,突然发现maven引用了一个protobuf-3.5.1的依赖,将此依赖去掉,问题解决!

问题总结:

在HBase 1.2.X版本及之前的版本HBase是强依赖于protobuf-2.5.0,如果在依赖中引入高版本的protobuf,会造成hbase的各种问题,所以在有HBase的项目中一定要慎重对待protobuf的版本

【Hadoop】熟悉常用的HBase操作(Java实现) 一、实验平台 操作系统:Linux(deepin) Hadoop版本:2.7.7 HBase版本:1.2.6 Java IDE:Eclipse 二、实验内容 1.使用Hadoop提供的Java编程共同实现以下指定功能: 列出HBase所有的表的相关信息,例如表名; 在终端打印出指定的表的所有记录数据; 向已经创建好的表添加和删... 阅读详情

相关推荐

Hbase连接异常,JAR包冲突解决攻略

Hbase连接异常(JAR包冲突),问题分析和解决攻略

fengcai19的专栏 7031

hbase中Bytes类的使用

import org.apache.hadoop.hbase.util.Bytes;public class ArrayTest { public static void main(String[] args) { byte[]x=new byte[8]; x[0]=1; x[1]=2; x[2]=3; x[3]=4; x[4]=5; x[5]

warm_day的博客 2400

企业级智能知识库问答AI助手(大模型+Python)

智能知识问答库AI助手

usa_washington的博客 1653

HBase JAVA API

导包 <dependencies> <dependency> <groupId>org.apache.hbase</groupId> <artifactId>hbase-client</artifactId> <version>1.4.6</version> </dependency> <dependency>

weixin_44778537的博客 982

Cursor 使用教程(2025年更新版)

官方Cursor详细使用教程在“扩展学习”

我是赛博AI Lewis 7082

STM32-DAC定时器触发三角波生成【频率与幅度精准控制】

本文详细介绍了STM32 DAC定时器触发三角波生成的原理与实现方法,涵盖硬件配置、频率与幅度精准控制技巧及代码实现。通过定时器触发DAC模块,可灵活调节三角波的频率和幅度,适用于信号发生器等高精度应用场景。

weixin_29161785的博客 452

【转】HBase查询报错:java.lang.NoClassDefFoundError:org.apache.hadoop.hbase.util.ByteStringer

https://blog.csdn.net/microGP/article/details/81705820 环境信息: Hadoop 2.7.2+HBase 1.2.2 现象: 下午前端的同事使用scan查询HBase数据,代码执行到Table.getScanner(scan)方法时卡住了,无法返回结果直到超时,查看控制台,出现如下报错:java.lang.NoClassDefFo...

freeRoad 714

从零开始用TS开发babylonjs - 本机环境搭建

babylonjs,初始化本地安装,web3d引擎

han3527638的专栏 793

java.lang.NoClassDefFoundError: Could not initialize class org.apache.hadoop.hbase.util.ByteStringer

2019独角兽企业重金招聘Python工程师标准>>> ...

weixin_34315189的博客 5464

Multisim实战:从零搭建体温检测报警电路(附完整仿真文件+调试技巧)

本文详细介绍了如何使用Multisim从零搭建体温检测报警电路,涵盖LM35温度传感器、LM358运算放大器等核心器件的选型与连接,以及信号调理、阈值比较和数码管显示等关键电路设计。附赠完整仿真文件和实用调试技巧,帮助电子工程初学者快速掌握体温温度检测系统的设计与实现。

weixin_28285943的博客 291

Vivado XDMA仿真实战:从配置到链路训练全解析

本文深入解析了Vivado中XDMA IP核的仿真实战流程,重点剖析了PCIe链路训练状态机(LTSSM)的工作原理与调试方法。通过搭建仿真环境、解读日志与波形,手把手指导如何从配置、链路训练(LTSSM)到BAR映射与DMA启动进行全流程分析与问题定位,帮助工程师掌握核心调试技能,确保PCIe链路稳定与数据传输正确。

weixin_29197051的博客 154

HBase与Protobuf3.0之间版本冲突的问题:java.lang.NoClassDefFoundError:org.apache.hadoop.hbase.util.ByteStringer

现象: 今天在给服务添加grpc接口的时候,查询hbase时突然报了如下错误:java.lang.NoClassDefFoundError:org.apache.hadoop.hbase.util.ByteStringer 问题分析: 1:在java中,出现NoClassDefFoundError时,一般都是jar冲突了,即依赖了同一个组件的不同版本,此时,需要把依赖树打出来看看,笔者用的是...

yubin1991的专栏 3144

crowdcountingp2p代码复现

前面学习了一下论文:Improved Field-Based Soybean Seed Counting and Localization with Feature Level Considered该论文的模型原型由CrowdCounting-P2PNet改进而来这里先复现一下CrowdCounting-P2PNet模型,然后再学习P2PNet-Soy模型。

m0_73832962的博客 2325

[HBase]Could not initialize class org.apache.hadoop.hbase.util.ByteStringer

报错信息: Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.apache.hadoop.hbase.util.ByteStringer at org.apache.hadoop.hbase.protobuf.RequestConverter.buildRegionSpecifier(RequestConverter.java:1037) at org.apache.hadoop.hbase.protobu

Crazy的博客 4287

17. ADC开发

bes2700 支持2路ADC。

雪飞_海 338

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

hadoop和hbase版本冲突

javaMylife的博客 455

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

hbase utils工具类

hbase操作工具类 import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.CompareOperator; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.*; import org.a.

mengo的博客 1485

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

spark sql hbase java,Spark SqlContext和Hbase:java.lang.NoClassDefFoundError:org / apache / hadoop / h...

I am trying to access the Hive table in Spark which is created on top hBase table.sqlContext.sql("select * from dev.hive_habse_table")Eventhough I have included all the required jar, like thisexport H...

weixin_36244678的博客 572

连接HBase的正确姿势

在云HBase值班的时候,经常会遇见有用户咨询诸如“HBase是否支持连接池?”这样的问题,也有用户因为应用中创建的Connection对象过多,触发了zookeeper的连接数限制,导致客户端连不上的。究其原因,都是因为对HBase客户端的原理不了解造成的。本文简单介绍HBase客户端的Connection对象与socket连接的关系,并给出Conne...

weixin_34387284的博客 1310

maven工程中连接hbase时“org.apache.hadoop.hbase.DoNotRetryIOException...”的解决

最近的一个maven工程中,需要连接hbase。由于服务器端的运行环境是hbase 1.2.5和hadoop 2.7.3,所以想当然地在pom.xml里加入相同版本的jar依赖: <project ...> ... <dependencies> <dependency> <groupId>org.apache.hb...

weixin_30779691的博客 5149

Java ClassNotFoundException异常解决指南

作为默语博主,深入研究和解决Java编程中常见的异常。在本博客中,我将分享关于这一异常的全面指南,涵盖了异常的基础知识、常见引发异常的情况、Java类加载机制、类路径和类加载器、异常处理方法以及高级类加载技巧。通过本文的深入研究,我们希望读者能够更好地理解和处理Java中的异常。合理的异常处理、良好的类加载机制设计以及高级的类加载技巧将有助于提升Java应用的稳定性和可维护性。

沉淀所学,分享所思,让热爱与成长同行。商务记录AI实战经验,助力开发者快速成长。 热爱AI,希望做出有影响力的技术成果。 技术点亮生活,分享连接价值与机会。 专注AI落地实战,陪你走好技术每一步。 3万+

java.lang.NoClassDefFoundError:Could not initialize class org.apache.hadoop.hbase.util.ByteStringer

java.lang.NoClassDefFoundError: Could not initialize class org.apache.hadoop.hbase.util.ByteStringer 版本冲突。 protobuf-java 需要是3.0.0 以下的。 <dependency> <groupId>com.google.protobuf</groupId> <artifactId>p

一杯派蒙的博客 2142

给hbase增加协处理器报ERROR: org.apache.hadoop.hbase.DoNotRetryIOException:错误

刚开始,我输入协处理器的语法是这样子输入的: alter 'publicDataset:comment',METHOD =>'table_att','coprocessor'=>'hdfs://node1:8020/putJar/test-corprocessor.jar|com.train.endpointserver.SimilarityServer|1001|' 但是一直报错,后来看报错提示说 You can add a table coprocessor by setting a ta

#姚大姚 的博客 4620

记一个 protobuf 的 jar 包冲突

尝试使用 spark 以 bulkload 的方式写 HBase 时,遇到一个问题,错误堆栈如下 19/02/02 09:00:43 ERROR Utils: Aborting task java.lang.NoSuchMethodError: org.apache.hadoop.hbase.util.ByteStringer.wrap([B)L/com/google/protobuf/B...

weixin_30655219的博客 709
上一篇: linux下僵尸进程的发现与处理(kill -9 无法杀掉的进程)
下一篇: HBase增加/修改/删除表的压缩方式
梦回从前
博客等级 码龄18年 65粉丝 89原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值