错误报告:
org.apache.hadoop.hbase.DoNotRetryIOException: java.lang.NoClassDefFoundError: com/google/protobuf/LiteralByteString
错误原因:
Protobuf(全称 Protocol Buffers)是 Google 开发的一种数据描述语言,能够将结构化数据序列化,可用于数据存储、通信协议等方面。在 HBase 里面用使用了 Protobuf 的类库。
运行mvn dependency:tree后发现MySQL8.0.13中有com.google.protobuf:protobuf-java:jar:3.6.1:compile。
具体原因:
查看了3.6.x的protobuf 的源码,里面并没有LiteralByteString这个类。
https://github.com/protocolbuffers/protobuf/tree/3.6.x/java/core/src/main/java/com/google/protobuf
查看了2.6.1及以下版本的protobuf 的源码,里面存在LiteralByteString这个类。
https://github.com/google/protobuf/blob/v2.5.0/java/src/main/java/com/google/protobuf/LiteralByteString.java
解决办法:
将mysql的驱动包更换为较低版本,比如8.0.13更换为5.1.46