my pom file:
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-client</artifactId>
<version>1.3.1</version>
<exclusions>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.2.0</version>
</dependency>
hbase-client 's protobuf conflict with grpc-1.2.0's protobuf
Please provide any error message you received.
In general, you should simply use protobuf v3.2. Since 3.0.0-beta-4, protobuf 3.x is compatible with generated code from 2.5.0 and 2.6.1.
I assuming the solution of using the newer protobuf works for you. If not, please comment and we can reopen.
The class com.google.protobuf.LiteralByteString is deleted from 2.6.1, how can protobuf 3.x be compatible with generated code from 2.5.0 and 2.6.1?
@KarlZhaoQiMing, the generated code doesn't use LiteralByteString. In fact, even 2.5.0 didn't have LiteralByteString _as part of the API_ (it's package-private). Looking at google/protobuf#1717 and trying to remember what was going on, I'm remembering now that HBase cheated to use it.
I see even in v1.0.0 hbase can fall-back to avoid HBaseZeroCopyByteString, but it appears it may not be catching enough exceptions (like NoClassDefFoundError).
Ping! Having the same trouble here. Any suggestions?
@markthegrea, I suggest "complain to HBase."
Not to beat a dead horse here, but the answer is here: https://github.com/os72/protobuf-java-shaded-351
The skinny is: use these different (google provided) maven jars and then Use Java namespace com.github.os72.protobuf351 instead of com.google.protobuf
Opened ticket in HBASE to address package private class reference: https://issues.apache.org/jira/browse/HBASE-21587
@mjpitz and @niyuelin1990, I think that the hbase-shaded-client artifact would solve this problem. Cloud Bigtable (see this pom.xml) and apache beam (see this builder.gradle) use it to avoid this problem.