Skip to content

[Issue 7402] Shaded jclouds to avoid gson conflict - #7435

Merged
jiazhai merged 1 commit into
apache:masterfrom
gaoran10:jclouds-shaded
Jul 5, 2020
Merged

jiazhai merged 1 commit into
apache:masterfrom
gaoran10:jclouds-shaded

Conversation

@gaoran10

@gaoran10 gaoran10 commented Jul 2, 2020

Copy link
Copy Markdown
Contributor

Fixes #7402

Motivation

Currently, the GCS offload error is still existing. In jclouds 2.2.0 and 2.2.1, it only shaded the package com.google.gson.internal, and in the class org.jclouds.json.internal.NullFilteringTypeAdapterFactories the shaded class org.jclouds.json.gson.internal.JsonReaderInternalAccess will be initialized by com.google.gson.stream.JsonReader which is in jclouds, the Pulsar include the same class com.google.gson.stream.JsonReader and when Pulsar broker start it will be loaded before jclouds's, so this will cause the org.jclouds.json.gson.internal.JsonReaderInternalAccess can't be initialized successfully, and occurs NPE.

Modifications

Shaded the jclouds to make the class org.jclouds.json.gson.internal.JsonReaderInternalAccess could be initialized normally.

Verifying this change

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (yes)
  • The public API: (no)
  • The schema: (no)
  • The default values of configurations: (no)
  • The wire protocol: (no)
  • The rest endpoints: (no)
  • The admin cli options: (no)
  • Anything that affects deployment: (no)

Documentation

  • Does this pull request introduce a new feature? (no)

@gaoran10 gaoran10 changed the title Shaded jclouds to avoid gson conflict [Issue 7402] Shaded jclouds to avoid gson conflict Jul 2, 2020
@gaoran10

gaoran10 commented Jul 2, 2020 •

Copy link
Copy Markdown
Contributor Author

Please reopen #7402, the #7400 only test successfully in the project org.apache.pulsar:tiered-storage-jcloud, the problem is still existing.

@gaoran10

gaoran10 commented Jul 5, 2020

Copy link
Copy Markdown
Contributor Author

/pulsarbot run-failure-checks

@jiazhai
jiazhai merged commit 53c50c1 into apache:master Jul 5, 2020
@codelipenghui codelipenghui added this to the 2.7.0 milestone Jul 24, 2020
deltasquare4 pushed a commit to pandio-com/pulsar that referenced this pull request Jul 30, 2020
Fixes apache#7402

Currently, the GCS offload error is still existing. In jclouds `2.2.0` and `2.2.1`, it only shaded the package [`com.google.gson.internal`](https://github.com/apache/jclouds/blob/master/gson/gson-shaded/pom.xml#L70), and in the class  [`org.jclouds.json.internal.NullFilteringTypeAdapterFactories`](https://github.com/apache/jclouds/blob/master/core/src/main/java/org/jclouds/json/internal/NullFilteringTypeAdapterFactories.java#L319) the shaded class `org.jclouds.json.gson.internal.JsonReaderInternalAccess` will be initialized by `com.google.gson.stream.JsonReader` which is in jclouds, the Pulsar include the same class `com.google.gson.stream.JsonReader` and when Pulsar broker start it will be loaded before  jclouds's, so this will cause the `org.jclouds.json.gson.internal.JsonReaderInternalAccess` can't be initialized successfully, and occurs NPE.

Shaded the jclouds to make the class `org.jclouds.json.gson.internal.JsonReaderInternalAccess` could be initialized normally.
huangdx0726 pushed a commit to huangdx0726/pulsar that referenced this pull request Aug 24, 2020
Fixes apache#7402 

### Motivation

Currently, the GCS offload error is still existing. In jclouds `2.2.0` and `2.2.1`, it only shaded the package [`com.google.gson.internal`](https://github.com/apache/jclouds/blob/master/gson/gson-shaded/pom.xml#L70), and in the class  [`org.jclouds.json.internal.NullFilteringTypeAdapterFactories`](https://github.com/apache/jclouds/blob/master/core/src/main/java/org/jclouds/json/internal/NullFilteringTypeAdapterFactories.java#L319) the shaded class `org.jclouds.json.gson.internal.JsonReaderInternalAccess` will be initialized by `com.google.gson.stream.JsonReader` which is in jclouds, the Pulsar include the same class `com.google.gson.stream.JsonReader` and when Pulsar broker start it will be loaded before  jclouds's, so this will cause the `org.jclouds.json.gson.internal.JsonReaderInternalAccess` can't be initialized successfully, and occurs NPE. 




### Modifications

Shaded the jclouds to make the class `org.jclouds.json.gson.internal.JsonReaderInternalAccess` could be initialized normally.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GCS offload operation error

3 participants