Skip to content

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.

[#1639]fix(all): Fix ClassNotFoundException of `javax/activation/DataSource` when using JDK9 or newer (#1660)

Qi Yu1628a7233082
diff --git a/LICENSE.bin b/LICENSE.bin
index 6f91d9ce18..806a7d64b2 100644
--- a/LICENSE.bin
+++ b/LICENSE.bin
@@ -417,3 +417,7 @@
AOP Alliance
+ This product bundles various third-party components also under the
+ COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) license
+
+ Javax Activation
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index e7d553710a..7dd5f26fc7 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -55,6 +55,7 @@ shadow-plugin = "8.1.1"
kerby = "2.0.3"
node-plugin = "7.0.1"
commons-cli = "1.2"
+sun-activation-version = "1.2.0"
[libraries]
protobuf-java = { group = "com.google.protobuf", name = "protobuf-java", version.ref = "protoc" }
@@ -144,6 +145,8 @@ postgresql-driver = { group = "org.postgresql", name = "postgresql", version.ref
minikdc = { group = "org.apache.hadoop", name = "hadoop-minikdc", version.ref = "hadoop-minikdc"}
immutables-value = { module = "org.immutables:value", version.ref = "immutables-value" }
commons-cli = { group = "commons-cli", name = "commons-cli", version.ref = "commons-cli" }
+sun-activation = { group = "com.sun.activation", name = "javax.activation", version.ref = "sun-activation-version" }
+
selenium = { group = "org.seleniumhq.selenium", name = "selenium-java", version.ref = "selenium" }
rauschig = { group = "org.rauschig", name = "jarchivelib", version.ref = "rauschig" }
diff --git a/server/build.gradle.kts b/server/build.gradle.kts
index 586ab2281d..74c319b977 100644
--- a/server/build.gradle.kts
+++ b/server/build.gradle.kts
@@ -27,6 +27,11 @@ dependencies {
implementation(libs.bundles.jersey)
implementation(libs.metrics.jersey2)
+ // As of Java 9 or newer, the javax.activation package (needed by the jetty server) is no longer part of the JDK. It was removed because it was part of the
+ // JavaBeans Activation Framework (JAF) which has been removed from Java SE. So we need to add it as a dependency. For more,
+ // please see: https://stackoverflow.com/questions/46493613/what-is-the-replacement-for-javax-activation-package-in-java-9
+ implementation(libs.sun.activation)
+
compileOnly(libs.lombok)
annotationProcessor(libs.lombok)
testCompileOnly(libs.lombok)