Skip to content

Commit

Permalink
[apache#2030] fix(client-spark): Remove javax and logging from reloca…
Browse files Browse the repository at this point in the history
…tion list to solve NoClassDefFoundError (apache#2029)

### What changes were proposed in this pull request?

Do not relocate javax to avoid NoClassDefFoundError issue.

### Why are the changes needed?

Fix: apache#2030

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Thanks for the verify check by @zhengchenyu . This is not reproduced on my env.

(cherry picked from commit 95537cd)
  • Loading branch information
maobaolong committed Oct 11, 2024
1 parent e9cb5f7 commit 8b36de5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 24 deletions.
19 changes: 7 additions & 12 deletions client-spark/spark2-shaded/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
<exclude>**/*.proto</exclude>
<exclude>**/*.css</exclude>
<exclude>**/*.html</exclude>
</excludes>
</filter>
</filters>
Expand Down Expand Up @@ -156,8 +158,10 @@
<pattern>org.apache</pattern>
<shadedPattern>${rss.shade.packageName}.org.apache</shadedPattern>
<excludes>
<!-- Exclude the provided dependencies -->
<!-- Exclude the packages belonging to uniffle -->
<exclude>org/apache/uniffle/**/*</exclude>
<!-- Exclude the packages belonging to hadoop -->
<exclude>org/apache/hadoop/*</exclude>
<exclude>org/apache/hadoop/**/*</exclude>
<!-- Exclude the logging packages-->
Expand All @@ -166,10 +170,13 @@
<exclude>org/apache/commons/logging/**/*</exclude>
<exclude>org/apache/log4j/*</exclude>
<exclude>org/apache/log4j/**/*</exclude>
<exclude>org/apache/logging/**/*</exclude>
<!-- Exclude spark packages -->
<exclude>org/apache/spark/**/*</exclude>
<!-- Exclude commons-io packages -->
<exclude>org/apache/commons/io/**/*</exclude>
<!-- Exclude the packages belonging to collections 3 -->
<exclude>org/apache/commons/collections/**/*</exclude>
</excludes>
</relocation>
<relocation>
Expand All @@ -180,18 +187,6 @@
<pattern>android.annotation</pattern>
<shadedPattern>${rss.shade.packageName}.android.annotation</shadedPattern>
</relocation>
<relocation>
<pattern>javax</pattern>
<shadedPattern>${rss.shade.packageName}.javax</shadedPattern>
<includes>
<include>javax/annotation/**/*</include>
<include>javax/activation/**/*</include>
<include>javax/xml/**/*</include>
<include>javax/inject/**/*</include>
<include>javax/validation/**/*</include>
<include>javax/servlet/**/*</include>
</includes>
</relocation>
<relocation>
<pattern>javassist</pattern>
<shadedPattern>${rss.shade.packageName}.javassist</shadedPattern>
Expand Down
19 changes: 7 additions & 12 deletions client-spark/spark3-shaded/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
<exclude>**/*.proto</exclude>
<exclude>**/*.css</exclude>
<exclude>**/*.html</exclude>
</excludes>
</filter>
</filters>
Expand Down Expand Up @@ -156,8 +158,10 @@
<pattern>org.apache</pattern>
<shadedPattern>${rss.shade.packageName}.org.apache</shadedPattern>
<excludes>
<!-- Exclude the provided dependencies -->
<!-- Exclude the packages belonging to uniffle -->
<exclude>org/apache/uniffle/**/*</exclude>
<!-- Exclude the packages belonging to hadoop -->
<exclude>org/apache/hadoop/*</exclude>
<exclude>org/apache/hadoop/**/*</exclude>
<!-- Exclude the logging packages-->
Expand All @@ -166,10 +170,13 @@
<exclude>org/apache/commons/logging/**/*</exclude>
<exclude>org/apache/log4j/*</exclude>
<exclude>org/apache/log4j/**/*</exclude>
<exclude>org/apache/logging/**/*</exclude>
<!-- Exclude spark packages -->
<exclude>org/apache/spark/**/*</exclude>
<!-- Exclude commons-io packages -->
<exclude>org/apache/commons/io/**/*</exclude>
<!-- Exclude the packages belonging to collections 3 -->
<exclude>org/apache/commons/collections/**/*</exclude>
</excludes>
</relocation>
<relocation>
Expand All @@ -180,18 +187,6 @@
<pattern>android.annotation</pattern>
<shadedPattern>${rss.shade.packageName}.android.annotation</shadedPattern>
</relocation>
<relocation>
<pattern>javax</pattern>
<shadedPattern>${rss.shade.packageName}.javax</shadedPattern>
<includes>
<include>javax/annotation/**/*</include>
<include>javax/activation/**/*</include>
<include>javax/xml/**/*</include>
<include>javax/inject/**/*</include>
<include>javax/validation/**/*</include>
<include>javax/servlet/**/*</include>
</includes>
</relocation>
<relocation>
<pattern>javassist</pattern>
<shadedPattern>${rss.shade.packageName}.javassist</shadedPattern>
Expand Down

0 comments on commit 8b36de5

Please sign in to comment.