edit-icon download-icon

Conflict with Protobuf or HttpClient when Java SDK is used

Last Updated: Apr 11, 2018

Symptom

Table Store Java SDK depends on Protobuf 2.4.1 and HttpAsyncClient 4.0.2, which are known to create conflicts with the same libraries inherent in your application.

Resolution

You can use the following versions provided by Table Store SDK.

  1. <dependency>
  2. <groupId>com.aliyun.openservices</groupId>
  3. <artifactId>ots-public</artifactId>
  4. <version>2.2.5</version>
  5. <classifier>jar-with-dependencies</classifier>
  6. <exclusions>
  7. <exclusion>
  8. <groupId>com.google.protobuf</groupId>
  9. <artifactId>protobuf-java</artifactId>
  10. </exclusion>
  11. </exclusions>
  12. </dependency>

Or:

  1. <dependency>
  2. <groupId>com.aliyun.openservices</groupId>
  3. <artifactId>tablestore</artifactId>
  4. <version>4.2.3</version>
  5. <classifier>jar-with-dependencies</classifier>
  6. <exclusions>
  7. <exclusion>
  8. <groupId>com.google.protobuf</groupId>
  9. <artifactId>protobuf-java</artifactId>
  10. </exclusion>
  11. </exclusions>
  12. </dependency>

Note: classifier is used to package HttpClient and Protobuf by using jar-with-dependencies and rename the package to remove dependencies on HttpClient and Protobuf.

Thank you! We've received your feedback.