diff --git a/addons/falcon-bridge/pom.xml b/addons/falcon-bridge/pom.xml
index 79903c065f5..ff737feb207 100644
--- a/addons/falcon-bridge/pom.xml
+++ b/addons/falcon-bridge/pom.xml
@@ -49,6 +49,16 @@
org.apache.atlas
hive-bridge
+
+
+ com.sun.jersey
+ *
+
+
+ org.apache.atlas
+ atlas-client-v2-shaded
+
+
@@ -105,6 +115,12 @@
+
+
+ org.apache.atlas
+ atlas-client-v2
+ test
+
org.apache.atlas
atlas-graphdb-impls
@@ -120,6 +136,22 @@
+
+
+ org.apache.maven.plugins
+ maven-failsafe-plugin
+
+ 1
+ false
+ false
+
+ org.apache.atlas:atlas-client-v2-shaded
+ org.glassfish.jersey.media:jersey-media-json-jackson
+
+
+
+
org.eclipse.jetty
jetty-maven-plugin
@@ -390,9 +422,14 @@
${kafka.version}
- com.sun.jersey
- jersey-json
- ${jersey.version}
+ org.glassfish.jersey.media
+ jersey-media-json-jackson
+ ${jersey2.version}
+
+
+ jakarta.ws.rs
+ jakarta.ws.rs-api
+ ${javax.ws.rs-api}
diff --git a/addons/falcon-bridge/src/test/resources/atlas-logback.xml b/addons/falcon-bridge/src/test/resources/atlas-logback.xml
index 991cb621de1..7568806ea93 100755
--- a/addons/falcon-bridge/src/test/resources/atlas-logback.xml
+++ b/addons/falcon-bridge/src/test/resources/atlas-logback.xml
@@ -104,7 +104,7 @@
-
+
diff --git a/addons/hbase-bridge-shim/pom.xml b/addons/hbase-bridge-shim/pom.xml
index f934e3bbf09..eb8a8845e1d 100644
--- a/addons/hbase-bridge-shim/pom.xml
+++ b/addons/hbase-bridge-shim/pom.xml
@@ -38,21 +38,111 @@
+
+ com.fasterxml.jackson.core
+ jackson-annotations
+ ${jackson.version}
+
+
+ com.fasterxml.jackson.core
+ jackson-core
+ ${jackson.version}
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+ ${jackson.version}
+
+
+ com.fasterxml.jackson.jaxrs
+ jackson-jaxrs-json-provider
+ ${jackson.version}
+
+
+ com.fasterxml.jackson.module
+ jackson-module-jaxb-annotations
+ ${jackson.version}
+
org.apache.atlas
atlas-plugin-classloader
+
+ org.glassfish.jersey.containers
+ jersey-container-servlet
+ ${jersey2.version}
+
+
+ org.glassfish.jersey.core
+ jersey-client
+ ${jersey2.version}
+
+
+ org.glassfish.jersey.core
+ jersey-server
+ ${jersey2.version}
+
+
+ org.glassfish.jersey.media
+ jersey-media-json-jackson
+ ${jersey2.version}
+
+
+ org.glassfish.jersey.media
+ jersey-media-multipart
+ ${jersey2.version}
+
org.apache.hbase
hbase-server
${hbase.version}
provided
+
+ com.fasterxml.jackson.core
+ jackson-annotations
+
+
+ com.fasterxml.jackson.core
+ jackson-core
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+
+
+ com.fasterxml.jackson.jaxrs:
+ jackson-jaxrs-json-provider
+
+
+ com.fasterxml.jackson.module
+ jackson-module-jaxb-annotations
+
com.github.stephenc.findbugs
findbugs-annotations
+
+ com.sun.jersey
+ jersey-client
+
+
+ com.sun.jersey
+ jersey-core
+
+
+ com.sun.jersey
+ jersey-json
+
+
+ com.sun.jersey
+ jersey-server
+
+
+ com.sun.jersey.contribs
+ *
+
javax.servlet
servlet-api
diff --git a/addons/hbase-bridge/pom.xml b/addons/hbase-bridge/pom.xml
index 76ea8dbc13c..e0cc8d1180e 100644
--- a/addons/hbase-bridge/pom.xml
+++ b/addons/hbase-bridge/pom.xml
@@ -42,6 +42,28 @@
+
+
+ com.fasterxml.jackson.core
+ jackson-core
+ ${jackson.version}
+
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+ ${jackson.databind.version}
+
+
+ com.fasterxml.jackson.dataformat
+ jackson-dataformat-yaml
+ ${jackson.version}
+
+
+ com.fasterxml.jackson.module
+ jackson-module-jaxb-annotations
+ ${jackson.version}
+
com.google.guava
guava
@@ -85,6 +107,12 @@
org.apache.hadoop
hadoop-client
${hadoop.version}
+
+
+ com.sun.jersey
+ *
+
+
org.apache.hadoop
@@ -111,6 +139,10 @@
hadoop-hdfs
${hadoop.version}
+
+ com.sun.jersey
+ *
+
javax.servlet
servlet-api
@@ -127,10 +159,30 @@
hadoop-minicluster
${hadoop.version}
+
+ com.fasterxml.jackson.dataformat
+ jackson-dataformat-yaml
+
+
+ com.sun.jersey
+ *
+
+
+ com.sun.jersey
+ *
+
+
+ com.sun.jersey.contribs
+ *
+
javax.servlet
servlet-api
+
+ javax.ws.rs
+ jsr311-api
+
org.apache.commons
commons-configuration2
@@ -174,6 +226,30 @@
${jetty.version}
compile
+
+
+ org.glassfish.jersey.containers
+ jersey-container-servlet
+ ${jersey2.version}
+
+
+
+ org.glassfish.jersey.core
+ jersey-client
+ ${jersey2.version}
+
+
+
+ org.glassfish.jersey.core
+ jersey-server
+ ${jersey2.version}
+
+
+
+ org.glassfish.jersey.media
+ jersey-media-json-jackson
+ ${jersey2.version}
+
org.mockito
mockito-core
@@ -196,6 +272,22 @@
${hbase.version}
provided
+
+ com.fasterxml.jackson.core
+ jackson-core
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+
+
+ com.sun.jersey
+ *
+
+
+ com.sun.jersey.contribs
+ *
+
javax.servlet
servlet-api
@@ -206,19 +298,41 @@
-
+
+
+
+ com.sun.jersey
+ jersey-core
+ ${jersey.version}
+ test
+
com.sun.jersey
- jersey-bundle
+ jersey-server
${jersey.version}
test
+
+ com.sun.jersey
+ jersey-servlet
+ ${jersey.version}
+ test
+
+
+
javax.ws.rs
javax.ws.rs-api
${javax.ws.rs-api.version}
test
+
+ javax.ws.rs
+ jsr311-api
+ 1.1.1
+ test
+
junit
junit
@@ -259,6 +373,10 @@
test-jar
test
+
+ com.fasterxml.jackson.module
+ jackson-module-jaxb-annotationsr
+
org.eclipse.jetty
jetty-server
@@ -297,6 +415,20 @@
+
+
+ org.apache.maven.plugins
+ maven-failsafe-plugin
+
+ 1
+ false
+ false
+
+ org.glassfish.jersey.media:jersey-media-json-jackson
+
+
+
+
org.eclipse.jetty
jetty-maven-plugin
@@ -512,6 +644,16 @@
atlas-client-v2
${project.version}
+
+ javax.inject
+ javax.inject
+ ${javax-inject.version}
+
+
+ javax.annotation
+ javax.annotation-api
+ 1.3.2
+
${project.groupId}
atlas-intg
@@ -548,9 +690,9 @@
${commons-logging.version}
- com.sun.jersey.contribs
- jersey-multipart
- ${jersey.version}
+ org.glassfish.jersey.media
+ jersey-media-multipart
+ ${jersey2.version}
com.fasterxml.jackson.core
@@ -582,20 +724,61 @@
commons-configuration2
${commons-conf2.version}
+
+
+ commons-configuration
+ commons-configuration
+ 1.10
+
org.apache.commons
commons-text
${commons-text.version}
- com.sun.jersey
- jersey-json
- ${jersey.version}
+ org.glassfish.jersey.media
+ jersey-media-json-jackson
+ ${jersey2.version}
+
+
+ org.glassfish.jersey.core
+ jersey-client
+ ${jersey2.version}
+
+
+ org.glassfish.jersey.core
+ jersey-common
+ ${jersey2.version}
+
+
+ jakarta.ws.rs
+ jakarta.ws.rs-api
+ ${javax.ws.rs-api}
+
+
+ org.glassfish.jersey.ext
+ jersey-entity-filtering
+ ${jersey2.version}
+
+
+ org.glassfish.jersey.inject
+ jersey-hk2
+ ${jersey2.version}
+
+
+ org.glassfish.hk2
+ hk2-api
+ ${hk2.version}
+
+
+ org.glassfish.hk2
+ hk2-locator
+ ${hk2.version}
- com.sun.jersey
- jersey-bundle
- ${jersey.version}
+ org.glassfish.hk2
+ hk2-utils
+ ${hk2.version}
ch.qos.logback
diff --git a/addons/hbase-bridge/src/bin/import-hbase.sh b/addons/hbase-bridge/src/bin/import-hbase.sh
index c92ff1907e2..b62ebac518d 100644
--- a/addons/hbase-bridge/src/bin/import-hbase.sh
+++ b/addons/hbase-bridge/src/bin/import-hbase.sh
@@ -104,7 +104,7 @@ HBASE_CP="${HBASE_CONF}"
# Multiple jars in HBASE_CP_EXCLUDE_LIST can be added using "\|" separator
# Ex: HBASE_CP_EXCLUDE_LIST="commons-configuration-1."
-HBASE_CP_EXCLUDE_LIST="commons-configuration-1\|jersey-client"
+HBASE_CP_EXCLUDE_LIST="javax.ws.rs-api\|jsr311-api\|jersey\|glassfish"
for i in "${HBASE_HOME}/lib/"*.jar "${HBASE_HOME}/lib/client-facing-thirdparty/"*.jar; do
if [ "`echo $i | grep -v \"$HBASE_CP_EXCLUDE_LIST\"`" == "$i" ]; then
@@ -124,6 +124,30 @@ else
echo "WARN: Environment variable HADOOP_CLASSPATH or HADOOP_HOME need to be set"
fi
+#Exclude libs from Hadoop classpath which are conflicting with Atlas
+HADOOP_CP_EXCLUDE_LIST=("jersey-core-1.19.jar" "jersey-json-1.19.jar" "jersey-server-1.19.jar" "jersey-servlet-1.19.jar" "jersey-client-1.19.jar" "jsr311-api-1.1.1.jar")
+
+# Construct the classpath excluding the specified JARs
+ORIGINAL_HADOOP_CLASSPATH=$(echo "$HADOOP_CP" | tr ':' '\n')
+for jar in $ORIGINAL_HADOOP_CLASSPATH
+do
+ excluded=false
+ for exclude_jar in "${HADOOP_CP_EXCLUDE_LIST[@]}"
+ do
+ if [[ "$jar" == *"$exclude_jar" ]]; then
+ excluded=true
+ break
+ fi
+ done
+
+ if [ "$excluded" = false ]; then
+ HADOOP_CLASSPATH_NEW="$HADOOP_CLASSPATH_NEW:$jar"
+ fi
+done
+
+# Remove leading colon
+HADOOP_CP=$(echo "$HADOOP_CLASSPATH_NEW" | sed 's/^://')
+
if [ ! -z "$HADOOP_CP" ]; then
CP="${ATLASCPPATH}:${HBASE_CP}:${HADOOP_CP}"
else
diff --git a/addons/hbase-bridge/src/test/resources/atlas-logback.xml b/addons/hbase-bridge/src/test/resources/atlas-logback.xml
index 5e96004c923..d7e44f9f365 100755
--- a/addons/hbase-bridge/src/test/resources/atlas-logback.xml
+++ b/addons/hbase-bridge/src/test/resources/atlas-logback.xml
@@ -121,7 +121,7 @@
-
+
diff --git a/addons/hbase-testing-util/pom.xml b/addons/hbase-testing-util/pom.xml
index 2fb66c557d1..e1ae4b9a6f6 100644
--- a/addons/hbase-testing-util/pom.xml
+++ b/addons/hbase-testing-util/pom.xml
@@ -41,11 +41,25 @@
+
+
+ com.fasterxml.jackson.core
+ jackson-core
+ ${jackson.version}
+
+
+
+ com.fasterxml.jackson.module
+ jackson-module-jaxb-annotations
+ ${jackson.version}
+
+
junit
junit
${junit.version}
+
org.apache.commons
commons-configuration2
@@ -86,6 +100,20 @@
hadoop-hdfs
${hadoop.version}
compile
+
+
+ com.sun.jersey
+ jersey-core
+
+
+ com.sun.jersey
+ jersey-server
+
+
+ javax.ws.rs
+ jsr311-api
+
+
org.apache.hadoop
@@ -93,6 +121,16 @@
${hadoop.version}
test-jar
compile
+
+
+ com.sun.jersey
+ jersey-core
+
+
+ com.sun.jersey
+ jersey-server
+
+
org.apache.hadoop
@@ -100,6 +138,30 @@
${hadoop.version}
compile
+
+ com.sun.jersey
+ jersey-client
+
+
+ com.sun.jersey
+ jersey-core
+
+
+ com.sun.jersey
+ jersey-json
+
+
+ com.sun.jersey
+ jersey-server
+
+
+ com.sun.jersey
+ jersey-servlet
+
+
+ com.sun.jersey.contribs
+ *
+
org.apache.commons
commons-configuration2
@@ -205,7 +267,42 @@
hbase-server
${hbase.version}
compile
+
+
+ com.fasterxml.jackson.core
+ jackson-core
+
+
+ com.fasterxml.jackson.module
+ jackson-module-jaxb-annotations
+
+
+ com.sun.jersey
+ jersey-client
+
+
+ com.sun.jersey
+ jersey-core
+
+
+ com.sun.jersey
+ jersey-json
+
+
+ com.sun.jersey
+ jersey-server
+
+
+ com.sun.jersey.contribs
+ *
+
+
+ org.glassfish.jersey.core
+ *
+
+
+
org.apache.hbase
hbase-server
@@ -227,6 +324,30 @@
test-jar
compile
+
+
+ org.glassfish.jersey.containers
+ jersey-container-servlet
+ ${jersey2.version}
+
+
+
+ org.glassfish.jersey.core
+ jersey-client
+ ${jersey2.version}
+
+
+
+ org.glassfish.jersey.core
+ jersey-server
+ ${jersey2.version}
+
+
+
+ org.glassfish.jersey.media
+ jersey-media-json-jackson
+ ${jersey2.version}
+
org.slf4j
slf4j-log4j12
@@ -247,5 +368,24 @@
${apache.log4j.version}
runtime
+
+
+ com.sun.jersey
+ jersey-core
+ ${jersey.version}
+ test
+
+
+ com.sun.jersey
+ jersey-server
+ ${jersey.version}
+ test
+
+
+ com.sun.jersey
+ jersey-servlet
+ ${jersey.version}
+ test
+
diff --git a/addons/hbase-testing-util/src/test/resources/atlas-logback.xml b/addons/hbase-testing-util/src/test/resources/atlas-logback.xml
index e5562bad136..7f8ecf62f35 100755
--- a/addons/hbase-testing-util/src/test/resources/atlas-logback.xml
+++ b/addons/hbase-testing-util/src/test/resources/atlas-logback.xml
@@ -104,7 +104,7 @@
-
+
diff --git a/addons/hive-bridge-shim/pom.xml b/addons/hive-bridge-shim/pom.xml
index 08a9ee7c42f..918f10b68be 100755
--- a/addons/hive-bridge-shim/pom.xml
+++ b/addons/hive-bridge-shim/pom.xml
@@ -33,17 +33,84 @@
Apache Atlas Hive Bridge Shim Module
+
+ com.fasterxml.jackson.dataformat
+ jackson-dataformat-yaml
+ ${jackson.version}
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-joda
+ ${jackson.version}
+
org.apache.atlas
atlas-plugin-classloader
+
+ org.glassfish.jersey.containers
+ jersey-container-servlet
+ ${jersey2.version}
+
+
+ org.glassfish.jersey.core
+ jersey-client
+ ${jersey2.version}
+
+
+ org.glassfish.jersey.core
+ jersey-server
+ ${jersey2.version}
+
+
+ org.glassfish.jersey.media
+ jersey-media-json-jackson
+ ${jersey2.version}
+
+
+ org.glassfish.jersey.media
+ jersey-media-multipart
+ ${jersey2.version}
+
org.apache.hive
hive-exec
${hive.version}
provided
+
+ com.fasterxml.jackson.dataformat
+ jackson-dataformat-yaml
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-joda
+
+
+ com.sun.jersey
+ jersey-client
+
+
+ com.sun.jersey
+ jersey-core
+
+
+ com.sun.jersey
+ jersey-json
+
+
+ com.sun.jersey
+ jersey-server
+
+
+ com.sun.jersey.contribs
+ *
+
+
+ javax.ws.rs
+ jsr311-api
+
org.apache.commons
commons-text
diff --git a/addons/hive-bridge/pom.xml b/addons/hive-bridge/pom.xml
index fd41c68bd61..507266260ee 100755
--- a/addons/hive-bridge/pom.xml
+++ b/addons/hive-bridge/pom.xml
@@ -34,12 +34,30 @@
+
+ com.fasterxml.jackson.core
+ jackson-core
+ ${jackson.version}
+
+
com.fasterxml.jackson.core
jackson-databind
${jackson.databind.version}
+
+ com.fasterxml.jackson.dataformat
+ jackson-dataformat-yaml
+ ${jackson.version}
+
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-joda
+ ${jackson.version}
+
+
org.apache.atlas
atlas-client-v1
@@ -48,7 +66,6 @@
org.apache.atlas
atlas-client-v2
- ${project.version}
@@ -71,6 +88,14 @@
org.apache.hadoop
hadoop-client
+
+ com.sun.jersey
+ *
+
+
+ com.sun.jersey.contribs
+ *
+
javax.servlet
servlet-api
@@ -86,6 +111,35 @@
+
+ org.glassfish.jersey.containers
+ jersey-container-servlet
+ ${jersey2.version}
+
+
+
+ org.glassfish.jersey.core
+ jersey-client
+ ${jersey2.version}
+
+
+
+ org.glassfish.jersey.core
+ jersey-server
+ ${jersey2.version}
+
+
+
+ org.glassfish.jersey.media
+ jersey-media-json-jackson
+ ${jersey2.version}
+
+
+
+ org.mockito
+ mockito-core
+ ${mockito.version}
+
org.slf4j
@@ -115,10 +169,30 @@
${hive.version}
provided
+
+ com.fasterxml.jackson.dataformat
+ jackson-dataformat-yaml
+
+
+ com.sun.jersey
+ *
+
+
+ com.sun.jersey.contribs
+ *
+
javax.servlet
*
+
+ javax.ws.rs
+ jsr311-api
+
+
+ org.apache.atlas
+ atlas-client-v2-shaded
+
@@ -128,10 +202,26 @@
${hive.version}
provided
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-joda
+
com.github.stephenc.findbugs
findbugs-annotations
+
+ com.sun.jersey
+ *
+
+
+ com.sun.jersey.contribs
+ *
+
+
+ log4j
+ log4j
+
org.eclipse.jetty
*
@@ -141,7 +231,6 @@
*
-
@@ -211,6 +300,10 @@
${hive.version}
test
+
+ com.sun.jersey
+ *
+
javax.servlet
*
@@ -242,6 +335,21 @@
+
+
+ org.apache.maven.plugins
+ maven-failsafe-plugin
+
+ 1
+ false
+
+ org.apache.atlas:atlas-client-v2-shaded
+ org.glassfish.jersey.media:jersey-media-json-jackson
+
+
+
+
org.eclipse.jetty
jetty-maven-plugin
@@ -454,19 +562,74 @@
${project.groupId}
- atlas-client-common
+ atlas-client-v1
${project.version}
${project.groupId}
- atlas-client-v1
+ atlas-client-v2
${project.version}
${project.groupId}
- atlas-client-v2
+ atlas-client-common
${project.version}
+
+ javax.inject
+ javax.inject
+ ${javax-inject.version}
+
+
+ javax.annotation
+ javax.annotation-api
+ 1.3.2
+
+
+ jakarta.ws.rs
+ jakarta.ws.rs-api
+ ${javax.ws.rs-api}
+
+
+ org.glassfish.jersey.core
+ jersey-client
+ ${jersey2.version}
+
+
+ org.glassfish.jersey.core
+ jersey-common
+ ${jersey2.version}
+
+
+ org.glassfish.jersey.inject
+ jersey-hk2
+ ${jersey2.version}
+
+
+ org.glassfish.jersey.media
+ jersey-media-json-jackson
+ ${jersey2.version}
+
+
+ org.glassfish.jersey.media
+ jersey-media-multipart
+ ${jersey2.version}
+
+
+ org.glassfish.jersey.ext
+ jersey-entity-filtering
+ ${jersey2.version}
+
+
+ com.fasterxml.jackson.jaxrs
+ jackson-jaxrs-json-provider
+ ${jackson.version}
+
+
+ com.fasterxml.jackson.jaxrs
+ jackson-jaxrs-base
+ ${jackson.version}
+
${project.groupId}
atlas-intg
@@ -492,11 +655,6 @@
kafka-clients
${kafka.version}
-
- com.sun.jersey.contribs
- jersey-multipart
- ${jersey.version}
-
com.fasterxml.jackson.core
jackson-databind
@@ -523,14 +681,19 @@
${commons-text.version}
- com.sun.jersey
- jersey-json
- ${jersey.version}
+ org.glassfish.hk2
+ hk2-api
+ ${hk2.version}
- com.sun.jersey
- jersey-client
- ${jersey.version}
+ org.glassfish.hk2
+ hk2-locator
+ ${hk2.version}
+
+
+ org.glassfish.hk2
+ hk2-utils
+ ${hk2.version}
ch.qos.logback
@@ -580,5 +743,22 @@
+
+ hive-it-jdk17
+
+ [9,)
+
+
+
+
+ org.apache.maven.plugins
+ maven-failsafe-plugin
+
+ --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED -Djava.system.class.loader=org.apache.atlas.hive.HiveITSystemClassLoader
+
+
+
+
+
diff --git a/addons/hive-bridge/src/bin/import-hive.sh b/addons/hive-bridge/src/bin/import-hive.sh
index eca58fab879..8af349f24eb 100755
--- a/addons/hive-bridge/src/bin/import-hive.sh
+++ b/addons/hive-bridge/src/bin/import-hive.sh
@@ -99,7 +99,7 @@ HIVE_CP="${HIVE_CONF}"
# Multiple jars in HIVE_CP_EXCLUDE_LIST can be added using "\|" separator
# Ex: HIVE_CP_EXCLUDE_LIST="jersey-multipart"
# exclude log4j libs from hive classpath to avoid conflict
-HIVE_CP_EXCLUDE_LIST="log4j-slf4j-impl\|log4j-1.2-api\|log4j-api\|log4j-core\|log4j-web"
+HIVE_CP_EXCLUDE_LIST="javax.ws.rs-api\|log4j-slf4j-impl\|log4j-1.2-api\|log4j-api\|log4j-core\|log4j-web\|jsr311-api\|jersey\|glassfish"
for i in $(find "${HIVE_HOME}/lib/" -name "*.jar" | grep -v "$HIVE_CP_EXCLUDE_LIST"); do
HIVE_CP="${HIVE_CP}:$i"
@@ -118,7 +118,32 @@ else
exit 1
fi
-CP="${HIVE_CP}:${HADOOP_CP}:${ATLASCPPATH}"
+#Exclude libs from Hadoop classpath which are conflicting with Atlas
+HADOOP_CP_EXCLUDE_LIST=("jersey-core-1.19.jar" "jersey-json-1.19.jar" "jersey-server-1.19.jar" "jersey-servlet-1.19.jar" "jersey-client-1.19.jar" "jsr311-api-1.1.1.jar")
+
+# Construct the classpath excluding the specified JARs
+ORIGINAL_HADOOP_CLASSPATH=$(echo "$HADOOP_CP" | tr ':' '\n')
+for jar in $ORIGINAL_HADOOP_CLASSPATH
+do
+ excluded=false
+ for exclude_jar in "${HADOOP_CP_EXCLUDE_LIST[@]}"
+ do
+ if [[ "$jar" == *"$exclude_jar" ]]; then
+ excluded=true
+ break
+ fi
+ done
+
+ if [ "$excluded" = false ]; then
+ HADOOP_CLASSPATH_NEW="$HADOOP_CLASSPATH_NEW:$jar"
+ fi
+done
+
+# Remove leading colon
+HADOOP_CP=$(echo "$HADOOP_CLASSPATH_NEW" | sed 's/^://')
+
+# Atlas hook jars must precede Hive/Hadoop so Jersey 2 + jakarta.ws.rs-api win over partial Hive libs.
+CP="${ATLASCPPATH}:${HIVE_CP}:${HADOOP_CP}"
# If running in cygwin, convert pathnames and classpath to Windows format.
if [ "${CYGWIN}" == "true" ]
diff --git a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java
index 083a66488a4..1118f0fad37 100755
--- a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java
+++ b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java
@@ -19,7 +19,6 @@
package org.apache.atlas.hive.bridge;
import com.google.common.annotations.VisibleForTesting;
-import com.sun.jersey.api.client.ClientResponse;
import org.apache.atlas.type.AtlasTypeUtil;
import org.apache.atlas.ApplicationProperties;
import org.apache.atlas.AtlasClientV2;
@@ -72,6 +71,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import javax.ws.rs.core.Response;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
@@ -893,7 +893,7 @@ private AtlasEntityWithExtInfo findEntity(final String typeName, final String qu
try {
ret = atlasClientV2.getEntityByAttribute(typeName, Collections.singletonMap(ATTRIBUTE_QUALIFIED_NAME, qualifiedName), minExtInfo, ignoreRelationship);
} catch (AtlasServiceException e) {
- if(e.getStatus() == ClientResponse.Status.NOT_FOUND) {
+ if (e.getStatus() != null && e.getStatus().getStatusCode() == Response.Status.NOT_FOUND.getStatusCode()) {
return null;
}
diff --git a/addons/hive-bridge/src/test/java/org/apache/atlas/hive/HiveITBase.java b/addons/hive-bridge/src/test/java/org/apache/atlas/hive/HiveITBase.java
index b5ea108548c..3f66e54eff9 100644
--- a/addons/hive-bridge/src/test/java/org/apache/atlas/hive/HiveITBase.java
+++ b/addons/hive-bridge/src/test/java/org/apache/atlas/hive/HiveITBase.java
@@ -55,6 +55,7 @@
import org.slf4j.LoggerFactory;
import org.testng.annotations.BeforeClass;
+import javax.ws.rs.core.Response;
import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
@@ -68,7 +69,7 @@
import java.util.SortedMap;
import java.util.SortedSet;
-import static com.sun.jersey.api.client.ClientResponse.Status.NOT_FOUND;
+import static javax.ws.rs.core.Response.Status.NOT_FOUND;
import static org.apache.atlas.hive.bridge.HiveMetaStoreBridge.HDFS_PATH;
import static org.apache.atlas.hive.hook.events.BaseHiveEvent.ATTRIBUTE_QUALIFIED_NAME;
import static org.apache.atlas.hive.model.HiveDataTypes.HIVE_DB;
@@ -106,7 +107,6 @@ public class HiveITBase {
public void setUp() throws Exception {
//Set-up hive session
conf = new HiveConf();
- conf.setClassLoader(Thread.currentThread().getContextClassLoader());
conf.set("hive.metastore.event.listeners", "");
// 'driver' using this configuration will be used for tests in HiveHookIT
@@ -118,23 +118,33 @@ public void setUp() throws Exception {
SessionState.setCurrentSessionState(ss);
- Configuration configuration = ApplicationProperties.get();
+ // SessionState.start swaps TCCL; align it with the Atlas client class loader for Jersey init.
+ ClassLoader hiveTccl = Thread.currentThread().getContextClassLoader();
+ ClassLoader atlasLoader = AtlasClientV2.class.getClassLoader();
- String[] atlasEndPoint = configuration.getStringArray(HiveMetaStoreBridge.ATLAS_ENDPOINT);
+ Thread.currentThread().setContextClassLoader(atlasLoader);
- if (atlasEndPoint == null || atlasEndPoint.length == 0) {
- atlasEndPoint = new String[] { DGI_URL };
- }
+ try {
+ Configuration configuration = ApplicationProperties.get();
- if (!AuthenticationUtil.isKerberosAuthenticationEnabled()) {
- atlasClientV2 = new AtlasClientV2(atlasEndPoint, new String[]{"admin", "admin"});
- atlasClient = new AtlasClient(atlasEndPoint, new String[]{"admin", "admin"});
- } else {
- atlasClientV2 = new AtlasClientV2(atlasEndPoint);
- atlasClient = new AtlasClient(atlasEndPoint);
- }
+ String[] atlasEndPoint = configuration.getStringArray(HiveMetaStoreBridge.ATLAS_ENDPOINT);
+
+ if (atlasEndPoint == null || atlasEndPoint.length == 0) {
+ atlasEndPoint = new String[] { DGI_URL };
+ }
- hiveMetaStoreBridge = new HiveMetaStoreBridge(configuration, conf, atlasClientV2);
+ if (!AuthenticationUtil.isKerberosAuthenticationEnabled()) {
+ atlasClientV2 = new AtlasClientV2(atlasEndPoint, new String[]{"admin", "admin"});
+ atlasClient = new AtlasClient(atlasEndPoint, new String[]{"admin", "admin"});
+ } else {
+ atlasClientV2 = new AtlasClientV2(atlasEndPoint);
+ atlasClient = new AtlasClient(atlasEndPoint);
+ }
+
+ hiveMetaStoreBridge = new HiveMetaStoreBridge(configuration, conf, atlasClientV2);
+ } finally {
+ Thread.currentThread().setContextClassLoader(hiveTccl);
+ }
HiveConf conf = new HiveConf();
@@ -382,7 +392,7 @@ protected void assertEntityIsNotRegistered(final String typeName, final String p
fail(String.format("Entity was not supposed to exist for typeName = %s, attributeName = %s, attributeValue = %s", typeName, property, value));
} catch (AtlasServiceException e) {
- if (e.getStatus() == NOT_FOUND) {
+ if (e.getStatus() != null && e.getStatus().getStatusCode() == Response.Status.NOT_FOUND.getStatusCode()) {
return;
}
}
diff --git a/addons/hive-bridge/src/test/java/org/apache/atlas/hive/HiveITSystemClassLoader.java b/addons/hive-bridge/src/test/java/org/apache/atlas/hive/HiveITSystemClassLoader.java
new file mode 100644
index 00000000000..176ab607ecb
--- /dev/null
+++ b/addons/hive-bridge/src/test/java/org/apache/atlas/hive/HiveITSystemClassLoader.java
@@ -0,0 +1,98 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.atlas.hive;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+
+/**
+ * Test JVM system class loader for hive-bridge integration tests on Java 9+.
+ * Hive 3.1.x {@code SessionState} casts {@code SessionState.class.getClassLoader()}
+ * to {@link URLClassLoader}; the default application loader is not a URLClassLoader
+ * on Java 9+, so tests install this loader via {@code -Djava.system.class.loader}.
+ */
+public final class HiveITSystemClassLoader extends URLClassLoader {
+ private static final ClassLoader PLATFORM_CLASS_LOADER = ClassLoader.getPlatformClassLoader();
+
+ static {
+ ClassLoader.registerAsParallelCapable();
+ }
+
+ public HiveITSystemClassLoader(ClassLoader parent) {
+ super(classpathUrls(), parent);
+ }
+
+ @Override
+ protected Class> loadClass(String name, boolean resolve) throws ClassNotFoundException {
+ synchronized (getClassLoadingLock(name)) {
+ Class> loadedClass = findLoadedClass(name);
+
+ if (loadedClass == null) {
+ if (isPlatformClass(name)) {
+ loadedClass = PLATFORM_CLASS_LOADER.loadClass(name);
+ } else {
+ try {
+ loadedClass = findClass(name);
+ } catch (ClassNotFoundException e) {
+ loadedClass = PLATFORM_CLASS_LOADER.loadClass(name);
+ }
+ }
+ }
+
+ if (resolve) {
+ resolveClass(loadedClass);
+ }
+
+ return loadedClass;
+ }
+ }
+
+ private static boolean isPlatformClass(String name) {
+ return name.startsWith("java.") || name.startsWith("jdk.");
+ }
+
+ private static URL[] classpathUrls() {
+ String classpath = System.getProperty("java.class.path");
+ String[] entries = classpath.split(File.pathSeparator);
+ URL[] urls = new URL[entries.length];
+ int urlCount = 0;
+
+ for (String entry : entries) {
+ if (entry.isEmpty()) {
+ continue;
+ }
+
+ try {
+ urls[urlCount++] = new File(entry).toURI().toURL();
+ } catch (MalformedURLException e) {
+ throw new IllegalStateException("Invalid classpath entry: " + entry, e);
+ }
+ }
+
+ if (urlCount == urls.length) {
+ return urls;
+ }
+
+ URL[] trimmed = new URL[urlCount];
+ System.arraycopy(urls, 0, trimmed, 0, urlCount);
+ return trimmed;
+ }
+}
diff --git a/addons/hive-bridge/src/test/java/org/apache/atlas/hive/hook/HiveHookIT.java b/addons/hive-bridge/src/test/java/org/apache/atlas/hive/hook/HiveHookIT.java
index 1ca43e615d0..e220fc02064 100755
--- a/addons/hive-bridge/src/test/java/org/apache/atlas/hive/hook/HiveHookIT.java
+++ b/addons/hive-bridge/src/test/java/org/apache/atlas/hive/hook/HiveHookIT.java
@@ -21,7 +21,6 @@
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.google.common.base.Joiner;
-import com.sun.jersey.api.client.ClientResponse;
import org.apache.atlas.ApplicationProperties;
import org.apache.atlas.AtlasClient;
import org.apache.atlas.AtlasServiceException;
@@ -58,6 +57,7 @@
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
+import javax.ws.rs.core.Response;
import java.text.ParseException;
import java.util.*;
@@ -298,7 +298,7 @@ public void testCreateTemporaryExternalTable() throws Exception {
try {
atlasClientV2.getEntityByAttribute(HiveDataTypes.HIVE_TABLE.getName(), Collections.singletonMap(ATTRIBUTE_QUALIFIED_NAME, tableQualifiedName));
} catch (AtlasServiceException e) {
- if (e.getStatus() == ClientResponse.Status.NOT_FOUND) {
+ if (e.getStatus() != null && e.getStatus().getStatusCode() == Response.Status.NOT_FOUND.getStatusCode()) {
return;
}
}
@@ -2101,7 +2101,7 @@ public void testDropDatabaseWithoutCascade() throws Exception {
try {
atlasClientV2.getEntityByAttribute(HiveDataTypes.HIVE_DB.getName(), Collections.singletonMap(ATTRIBUTE_QUALIFIED_NAME, dbQualifiedName));
} catch (AtlasServiceException e) {
- if (e.getStatus() == ClientResponse.Status.NOT_FOUND) {
+ if (e.getStatus() != null && e.getStatus().getStatusCode() == Response.Status.NOT_FOUND.getStatusCode()) {
return;
}
}
diff --git a/addons/hive-bridge/src/test/resources/atlas-logback.xml b/addons/hive-bridge/src/test/resources/atlas-logback.xml
index 0aa06e29eee..303bd7d59b2 100755
--- a/addons/hive-bridge/src/test/resources/atlas-logback.xml
+++ b/addons/hive-bridge/src/test/resources/atlas-logback.xml
@@ -104,7 +104,7 @@
-
+
diff --git a/addons/impala-bridge/pom.xml b/addons/impala-bridge/pom.xml
index d6bee8ff27d..9b37afc906b 100644
--- a/addons/impala-bridge/pom.xml
+++ b/addons/impala-bridge/pom.xml
@@ -40,6 +40,12 @@
${jackson.databind.version}
+
+ com.fasterxml.jackson.core
+ jackson-databind
+ ${jackson.databind.version}
+
+
commons-cli
commons-cli
@@ -77,10 +83,18 @@
org.apache.hadoop
hadoop-client
+
+ com.sun.jersey
+ *
+
javax.servlet
servlet-api
+
+ org.apache.commons
+ commons-configuration2
+
org.apache.commons
commons-text
@@ -92,6 +106,36 @@
+
+ org.glassfish.jersey.containers
+ jersey-container-servlet
+ ${jersey2.version}
+
+
+
+ org.glassfish.jersey.core
+ jersey-client
+ ${jersey2.version}
+
+
+
+ org.glassfish.jersey.core
+ jersey-server
+ ${jersey2.version}
+
+
+
+ org.glassfish.jersey.media
+ jersey-media-json-jackson
+ ${jersey2.version}
+
+
+
+ org.glassfish.jersey.media
+ jersey-media-multipart
+ ${jersey2.version}
+
+
org.mockito
mockito-core
@@ -122,13 +166,6 @@
test
-
- com.sun.jersey
- jersey-server
- ${jersey.version}
- test
-
-
org.apache.atlas
@@ -177,6 +214,14 @@
${hive.version}
test
+
+ com.sun.jersey
+ *
+
+
+ com.sun.jersey.contribs
+ *
+
javax.servlet
*
@@ -194,6 +239,14 @@
${hive.version}
test
+
+ com.sun.jersey
+ *
+
+
+ com.sun.jersey.contribs
+ *
+
javax.servlet
*
@@ -207,6 +260,10 @@
${hive.version}
test
+
+ com.sun.jersey
+ *
+
javax.servlet
*
@@ -227,6 +284,13 @@
jetty-server
test
+
+
+ org.glassfish.jersey.core
+ jersey-server
+ ${jersey2.version}
+ test
+
@@ -481,9 +545,9 @@
${kafka.version}
- com.sun.jersey.contribs
- jersey-multipart
- ${jersey.version}
+ org.glassfish.jersey.media
+ jersey-media-multipart
+ ${jersey2.version}
com.fasterxml.jackson.core
@@ -506,9 +570,14 @@
${commons-conf2.version}
- com.sun.jersey
- jersey-json
- ${jersey.version}
+ org.glassfish.jersey.media
+ jersey-media-json-jackson
+ ${jersey2.version}
+
+
+ jakarta.ws.rs
+ jakarta.ws.rs-api
+ ${javax.ws.rs-api}
diff --git a/addons/impala-bridge/src/test/resources/atlas-logback.xml b/addons/impala-bridge/src/test/resources/atlas-logback.xml
index 78fd420dc82..271fdf0ca42 100644
--- a/addons/impala-bridge/src/test/resources/atlas-logback.xml
+++ b/addons/impala-bridge/src/test/resources/atlas-logback.xml
@@ -104,7 +104,7 @@
-
+
diff --git a/addons/kafka-bridge/pom.xml b/addons/kafka-bridge/pom.xml
index 9782faf8768..d8f555c5665 100644
--- a/addons/kafka-bridge/pom.xml
+++ b/addons/kafka-bridge/pom.xml
@@ -39,6 +39,12 @@
+
+
+ com.fasterxml.jackson.core
+ jackson-core
+ ${jackson.version}
+
com.google.guava
guava
@@ -115,6 +121,30 @@
compile
+
+ org.glassfish.jersey.containers
+ jersey-container-servlet
+ ${jersey2.version}
+
+
+
+ org.glassfish.jersey.core
+ jersey-client
+ ${jersey2.version}
+
+
+
+ org.glassfish.jersey.core
+ jersey-server
+ ${jersey2.version}
+
+
+
+ org.glassfish.jersey.media
+ jersey-media-json-jackson
+ ${jersey2.version}
+
+
org.mockito
mockito-core
@@ -127,12 +157,12 @@
-
+
org.apache.atlas
@@ -152,6 +182,10 @@
hadoop-hdfs
test
+
+ com.sun.jersey
+ *
+
javax.servlet
servlet-api
@@ -165,6 +199,14 @@
${hadoop.version}
test
+
+ com.sun.jersey
+ *
+
+
+ com.sun.jersey.contribs
+ *
+
javax.servlet
servlet-api
@@ -440,15 +482,35 @@
commons-lang3
${commons-lang3.version}
+
+ javax.inject
+ javax.inject
+ ${javax-inject.version}
+
+
+ javax.annotation
+ javax.annotation-api
+ 1.3.2
+
org.apache.kafka
kafka-clients
${kafka.version}
- com.sun.jersey.contribs
- jersey-multipart
- ${jersey.version}
+ org.glassfish.jersey.media
+ jersey-media-json-jackson
+ ${jersey2.version}
+
+
+ org.glassfish.jersey.core
+ jersey-client
+ ${jersey2.version}
+
+
+ org.glassfish.jersey.core
+ jersey-common
+ ${jersey2.version}
com.fasterxml.jackson.core
@@ -476,9 +538,9 @@
${jackson.version}
- com.sun.jersey
- jersey-bundle
- ${jersey.version}
+ org.glassfish.jersey.media
+ jersey-media-multipart
+ ${jersey2.version}
org.apache.hadoop
@@ -520,6 +582,11 @@
json-simple
${json-simple.version}
+
+ jakarta.ws.rs
+ jakarta.ws.rs-api
+ ${javax.ws.rs-api}
+
org.apache.hadoop
hadoop-common
@@ -540,6 +607,31 @@
slf4j-api
${slf4j.version}
+
+ org.glassfish.jersey.ext
+ jersey-entity-filtering
+ ${jersey2.version}
+
+
+ org.glassfish.jersey.inject
+ jersey-hk2
+ ${jersey2.version}
+
+
+ org.glassfish.hk2
+ hk2-api
+ ${hk2.version}
+
+
+ org.glassfish.hk2
+ hk2-locator
+ ${hk2.version}
+
+
+ org.glassfish.hk2
+ hk2-utils
+ ${hk2.version}
+
diff --git a/addons/kafka-bridge/src/test/resources/atlas-logback.xml b/addons/kafka-bridge/src/test/resources/atlas-logback.xml
index 78fd420dc82..271fdf0ca42 100755
--- a/addons/kafka-bridge/src/test/resources/atlas-logback.xml
+++ b/addons/kafka-bridge/src/test/resources/atlas-logback.xml
@@ -104,7 +104,7 @@
-
+
diff --git a/addons/sqoop-bridge/pom.xml b/addons/sqoop-bridge/pom.xml
index ea1bc94bab3..966cf70a331 100644
--- a/addons/sqoop-bridge/pom.xml
+++ b/addons/sqoop-bridge/pom.xml
@@ -34,6 +34,12 @@
+
+ com.fasterxml.jackson.core
+ jackson-databind
+ ${jackson.version}
+
+
org.apache.atlas
atlas-client-v1
@@ -47,6 +53,12 @@
org.apache.atlas
hive-bridge
+
+
+ org.apache.atlas
+ atlas-client-v2-shaded
+
+
@@ -58,6 +70,10 @@
org.apache.hadoop
hadoop-client
+
+ com.sun.jersey
+ *
+
javax.servlet
servlet-api
@@ -73,6 +89,20 @@
org.apache.hive
hive-common
${hive.version}
+
+
+ com.sun.jersey
+ *
+
+
+ com.sun.jersey
+ *
+
+
+ com.sun.jersey.contribs
+ *
+
+
@@ -82,6 +112,36 @@
${sqoop.classifier}
compile
+
+
+ org.glassfish.jersey.containers
+ jersey-container-servlet
+ ${jersey2.version}
+
+
+
+ org.glassfish.jersey.core
+ jersey-client
+ ${jersey2.version}
+
+
+
+ org.glassfish.jersey.core
+ jersey-server
+ ${jersey2.version}
+
+
+
+ org.glassfish.jersey.media
+ jersey-media-json-jackson
+ ${jersey2.version}
+
+
+
+ org.glassfish.jersey.media
+ jersey-media-multipart
+ ${jersey2.version}
+
org.slf4j
@@ -110,6 +170,20 @@
hive-exec
${hive.version}
provided
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-joda
+
+
+ com.sun.jersey
+ *
+
+
+ com.sun.jersey.contribs
+ *
+
+
@@ -118,10 +192,22 @@
${hive.version}
provided
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-joda
+
com.github.stephenc.findbugs
findbugs-annotations
+
+ com.sun.jersey
+ *
+
+
+ com.sun.jersey.contribs
+ *
+
org.mortbay.jetty
*
@@ -129,6 +215,12 @@
+
+ org.apache.atlas
+ atlas-client-v2
+ test
+
+
org.apache.atlas
atlas-graphdb-impls
@@ -150,6 +242,14 @@
${hive.version}
test
+
+ com.sun.jersey
+ *
+
+
+ com.sun.jersey.contribs
+ *
+
javax.servlet
*
@@ -177,6 +277,22 @@
+
+
+ org.apache.maven.plugins
+ maven-failsafe-plugin
+
+ 1
+ false
+ false
+
+ org.apache.atlas:atlas-client-v2-shaded
+ org.glassfish.jersey.media:jersey-media-json-jackson
+
+
+
+
org.eclipse.jetty
jetty-maven-plugin
@@ -437,9 +553,14 @@
${kafka.version}
- com.sun.jersey
- jersey-json
- ${jersey.version}
+ org.glassfish.jersey.media
+ jersey-media-json-jackson
+ ${jersey2.version}
+
+
+ jakarta.ws.rs
+ jakarta.ws.rs-api
+ ${javax.ws.rs-api}
diff --git a/addons/sqoop-bridge/src/test/resources/atlas-logback.xml b/addons/sqoop-bridge/src/test/resources/atlas-logback.xml
index 78fd420dc82..271fdf0ca42 100755
--- a/addons/sqoop-bridge/src/test/resources/atlas-logback.xml
+++ b/addons/sqoop-bridge/src/test/resources/atlas-logback.xml
@@ -104,7 +104,7 @@
-
+
diff --git a/addons/storm-bridge/pom.xml b/addons/storm-bridge/pom.xml
index 42e325f1c72..7b8534db4ad 100644
--- a/addons/storm-bridge/pom.xml
+++ b/addons/storm-bridge/pom.xml
@@ -74,6 +74,12 @@
org.apache.atlas
hive-bridge
+
+
+ org.apache.atlas
+ atlas-client-v2-shaded
+
+
@@ -155,6 +161,14 @@
${hive.version}
provided
+
+ com.sun.jersey
+ *
+
+
+ com.sun.jersey.contribs
+ *
+
javax.servlet
*
@@ -201,6 +215,22 @@
+
+
+ org.apache.maven.plugins
+ maven-failsafe-plugin
+
+ 1
+ false
+ false
+
+ org.apache.atlas:atlas-client-v2-shaded
+ org.glassfish.jersey.media:jersey-media-json-jackson
+
+
+
+
org.eclipse.jetty
jetty-maven-plugin
diff --git a/addons/trino-extractor/pom.xml b/addons/trino-extractor/pom.xml
index a7a66b937ea..2903b3c583a 100644
--- a/addons/trino-extractor/pom.xml
+++ b/addons/trino-extractor/pom.xml
@@ -42,11 +42,6 @@
ch.qos.logback
logback-classic
-
- com.sun.jersey
- jersey-client
- 1.9
-
io.trino
@@ -62,6 +57,11 @@
org.apache.atlas
atlas-intg
+
+ org.glassfish.jersey.core
+ jersey-client
+ ${jersey2.version}
+
org.quartz-scheduler
quartz
diff --git a/addons/trino-extractor/src/main/java/org/apache/atlas/trino/client/AtlasClientHelper.java b/addons/trino-extractor/src/main/java/org/apache/atlas/trino/client/AtlasClientHelper.java
index e71cc0776e2..dd4d4107baa 100644
--- a/addons/trino-extractor/src/main/java/org/apache/atlas/trino/client/AtlasClientHelper.java
+++ b/addons/trino-extractor/src/main/java/org/apache/atlas/trino/client/AtlasClientHelper.java
@@ -17,7 +17,6 @@
*/
package org.apache.atlas.trino.client;
-import com.sun.jersey.api.client.ClientResponse;
import org.apache.atlas.AtlasClientV2;
import org.apache.atlas.AtlasServiceException;
import org.apache.atlas.model.discovery.AtlasSearchResult;
@@ -37,6 +36,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import javax.ws.rs.core.Response;
+
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
@@ -250,7 +251,7 @@ public AtlasEntityWithExtInfo findEntity(final String typeName, final String qua
try {
return atlasClientV2.getEntityByAttribute(typeName, Collections.singletonMap(ATTRIBUTE_QUALIFIED_NAME, qualifiedName), minExtInfo, ignoreRelationship);
} catch (AtlasServiceException e) {
- if (e.getStatus() == ClientResponse.Status.NOT_FOUND) {
+ if (e.getStatus() != null && e.getStatus().getStatusCode() == Response.Status.NOT_FOUND.getStatusCode()) {
return null;
}
diff --git a/atlas-examples/sample-app/src/main/java/org/apache/atlas/examples/sampleapp/TypeDefExample.java b/atlas-examples/sample-app/src/main/java/org/apache/atlas/examples/sampleapp/TypeDefExample.java
index 5ccdc354823..718f870f8eb 100644
--- a/atlas-examples/sample-app/src/main/java/org/apache/atlas/examples/sampleapp/TypeDefExample.java
+++ b/atlas-examples/sample-app/src/main/java/org/apache/atlas/examples/sampleapp/TypeDefExample.java
@@ -17,7 +17,6 @@
*/
package org.apache.atlas.examples.sampleapp;
-import com.sun.jersey.core.util.MultivaluedMapImpl;
import org.apache.atlas.AtlasClientV2;
import org.apache.atlas.AtlasServiceException;
import org.apache.atlas.model.SearchFilter;
@@ -32,6 +31,7 @@
import org.apache.atlas.model.typedef.AtlasTypesDef;
import org.apache.atlas.type.AtlasTypeUtil;
+import javax.ws.rs.core.MultivaluedHashMap;
import javax.ws.rs.core.MultivaluedMap;
import java.util.Arrays;
@@ -122,7 +122,7 @@ public void createTypeDefinitions() throws Exception {
public void printTypeDefinitions() throws AtlasServiceException {
for (String typeName : SAMPLE_APP_TYPES) {
- MultivaluedMap searchParams = new MultivaluedMapImpl();
+ MultivaluedMap searchParams = new MultivaluedHashMap();
searchParams.add(SearchFilter.PARAM_NAME, typeName);
diff --git a/client/client-v1/src/main/java/org/apache/atlas/AtlasClient.java b/client/client-v1/src/main/java/org/apache/atlas/AtlasClient.java
index 8dfb6d2c9d0..20cfcfc914a 100644
--- a/client/client-v1/src/main/java/org/apache/atlas/AtlasClient.java
+++ b/client/client-v1/src/main/java/org/apache/atlas/AtlasClient.java
@@ -22,11 +22,11 @@
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.google.common.annotations.VisibleForTesting;
-import com.sun.jersey.api.client.WebResource;
import org.apache.atlas.model.legacy.EntityResult;
import org.apache.atlas.type.AtlasType;
import org.apache.atlas.typesystem.types.DataTypes;
import org.apache.atlas.utils.AtlasJson;
+import org.apache.atlas.utils.ParamChecker;
import org.apache.atlas.v1.model.instance.Referenceable;
import org.apache.atlas.v1.model.instance.Struct;
import org.apache.atlas.v1.model.typedef.AttributeDefinition;
@@ -40,6 +40,7 @@
import org.slf4j.LoggerFactory;
import javax.ws.rs.HttpMethod;
+import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.Cookie;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;
@@ -178,7 +179,7 @@ public AtlasClient(Configuration configuration, String... baseUrls) throws Atlas
}
@VisibleForTesting
- AtlasClient(WebResource service, Configuration configuration) {
+ AtlasClient(WebTarget service, Configuration configuration) {
super(service, configuration);
}
@@ -192,7 +193,7 @@ public static String toString(ArrayNode jsonArray) {
return StringUtils.join(resultsList, ",");
}
- public WebResource getResource() {
+ public WebTarget getResource() {
return service;
}
@@ -316,7 +317,7 @@ public List listTypes() throws AtlasServiceException {
public List listTypes(final DataTypes.TypeCategory category) throws AtlasServiceException {
final API api = API_V1.LIST_TYPES;
ObjectNode response = callAPIWithRetries(api, null, () -> {
- WebResource resource = getResource(api.getNormalizedPath());
+ WebTarget resource = getResource(api.getNormalizedPath());
resource = resource.queryParam(TYPE, category.name());
@@ -341,7 +342,7 @@ public List listTypes(final DataTypes.TypeCategory category) throws Atla
public List listTypes(final DataTypes.TypeCategory category, final String superType, final String notSupertype) throws AtlasServiceException {
final API api = API_V1.LIST_TYPES;
ObjectNode response = callAPIWithRetries(api, null, () -> {
- WebResource resource = getResource(api);
+ WebTarget resource = getResource(api);
resource = resource.queryParam(TYPE, category.name());
resource = resource.queryParam(SUPERTYPE, superType);
@@ -412,9 +413,11 @@ public EntityResult updateEntities(Collection entities) throws At
public EntityResult updateEntityAttribute(final String guid, final String attribute, String value) throws AtlasServiceException {
LOG.debug("Updating entity id: {}, attribute name: {}, attribute value: {}", guid, attribute, value);
+ ParamChecker.notNull(attribute, "Entity property cannot be null");
+
final API api = API_V1.UPDATE_ENTITY_PARTIAL;
ObjectNode response = callAPIWithRetries(api, value, () -> {
- WebResource resource = getResource(api, guid);
+ WebTarget resource = getResource(api, guid);
resource = resource.queryParam(ATTRIBUTE_NAME, attribute);
@@ -482,7 +485,7 @@ public EntityResult updateEntity(final String entityType, final String uniqueAtt
LOG.debug("Updating entity type: {}, attributeName: {}, attributeValue: {}, entity: {}", entityType, uniqueAttributeName, uniqueAttributeValue, entityJson);
ObjectNode response = callAPIWithRetries(api, entityJson, () -> {
- WebResource resource = getResource(api, QUALIFIED_NAME);
+ WebTarget resource = getResource(api, QUALIFIED_NAME);
resource = resource.queryParam(TYPE, entityType);
resource = resource.queryParam(ATTRIBUTE_NAME, uniqueAttributeName);
@@ -510,7 +513,7 @@ public EntityResult deleteEntities(final String... guids) throws AtlasServiceExc
final API api = API_V1.DELETE_ENTITIES;
ObjectNode jsonResponse = callAPIWithRetries(api, null, () -> {
- WebResource resource = getResource(api);
+ WebTarget resource = getResource(api);
for (String guid : guids) {
resource = resource.queryParam(GUID.toLowerCase(), guid);
@@ -538,7 +541,7 @@ public EntityResult deleteEntity(String entityType, String uniqueAttributeName,
LOG.debug("Deleting entity type: {}, attributeName: {}, attributeValue: {}", entityType, uniqueAttributeName, uniqueAttributeValue);
API api = API_V1.DELETE_ENTITIES;
- WebResource resource = getResource(api);
+ WebTarget resource = getResource(api);
resource = resource.queryParam(TYPE, entityType);
resource = resource.queryParam(ATTRIBUTE_NAME, uniqueAttributeName);
@@ -578,7 +581,7 @@ public Referenceable getEntity(String guid) throws AtlasServiceException {
public Referenceable getEntity(final String entityType, final String attribute, final String value) throws AtlasServiceException {
final API api = API_V1.GET_ENTITY;
ObjectNode jsonResponse = callAPIWithRetries(api, null, () -> {
- WebResource resource = getResource(api);
+ WebTarget resource = getResource(api);
resource = resource.queryParam(TYPE, entityType);
resource = resource.queryParam(ATTRIBUTE_NAME, attribute);
@@ -601,7 +604,7 @@ public Referenceable getEntity(final String entityType, final String attribute,
*/
public List listEntities(final String entityType) throws AtlasServiceException {
ObjectNode jsonResponse = callAPIWithRetries(API_V1.LIST_ENTITIES, null, () -> {
- WebResource resource = getResource(API_V1.LIST_ENTITIES);
+ WebTarget resource = getResource(API_V1.LIST_ENTITIES);
resource = resource.queryParam(TYPE, entityType);
@@ -681,7 +684,7 @@ public List getEntityAuditEvents(String entityId, short numRes
* @throws AtlasServiceException
*/
public List getEntityAuditEvents(String entityId, String startKey, short numResults) throws AtlasServiceException {
- WebResource resource = getResource(API_V1.LIST_ENTITY_AUDIT, entityId, URI_ENTITY_AUDIT);
+ WebTarget resource = getResource(API_V1.LIST_ENTITY_AUDIT, entityId, URI_ENTITY_AUDIT);
if (StringUtils.isNotEmpty(startKey)) {
resource = resource.queryParam(START_KEY, startKey);
@@ -711,7 +714,7 @@ EntityAuditEvent extractElement(ObjectNode element) {
public JsonNode search(final String searchQuery, final int limit, final int offset) throws AtlasServiceException {
final API api = API_V1.SEARCH;
ObjectNode result = callAPIWithRetries(api, null, () -> {
- WebResource resource = getResource(api);
+ WebTarget resource = getResource(api);
resource = resource.queryParam(QUERY, searchQuery);
resource = resource.queryParam(LIMIT, String.valueOf(limit));
@@ -737,7 +740,7 @@ public ArrayNode searchByDSL(final String query, final int limit, final int offs
final API api = API_V1.SEARCH_DSL;
ObjectNode response = callAPIWithRetries(api, null, () -> {
- WebResource resource = getResource(api);
+ WebTarget resource = getResource(api);
resource = resource.queryParam(QUERY, query);
resource = resource.queryParam(LIMIT, String.valueOf(limit));
@@ -764,7 +767,7 @@ public ObjectNode searchByFullText(final String query, final int limit, final in
final API api = API_V1.SEARCH_FULL_TEXT;
return callAPIWithRetries(api, null, () -> {
- WebResource resource = getResource(api);
+ WebTarget resource = getResource(api);
resource = resource.queryParam(QUERY, query);
resource = resource.queryParam(LIMIT, String.valueOf(limit));
@@ -806,17 +809,17 @@ public ObjectNode getSchemaForEntity(String datasetId) throws AtlasServiceExcept
// Wrapper methods for compatibility
@VisibleForTesting
- public ObjectNode callAPIWithResource(API api, WebResource resource) throws AtlasServiceException {
+ public ObjectNode callAPIWithResource(API api, WebTarget resource) throws AtlasServiceException {
return callAPIWithResource(api, resource, null, ObjectNode.class);
}
@VisibleForTesting
- public ObjectNode callAPIWithResource(API_V1 apiV1, WebResource resource) throws AtlasServiceException {
+ public ObjectNode callAPIWithResource(API_V1 apiV1, WebTarget resource) throws AtlasServiceException {
return callAPIWithResource(apiV1, resource, null, ObjectNode.class);
}
@VisibleForTesting
- public WebResource getResource(API api, String... params) {
+ public WebTarget getResource(API api, String... params) {
return getResource(api.getNormalizedPath(), params);
}
@@ -831,7 +834,7 @@ ObjectNode callAPIWithRetries(API api, Object requestObject, ResourceCreator res
}
@VisibleForTesting
- public WebResource getResource(API_V1 apiV1, String... params) {
+ public WebTarget getResource(API_V1 apiV1, String... params) {
return getResource(apiV1.getNormalizedPath(), params);
}
diff --git a/client/client-v1/src/test/java/org/apache/atlas/AtlasAdminClientTest.java b/client/client-v1/src/test/java/org/apache/atlas/AtlasAdminClientTest.java
index f6f1026a61c..06ce59d7e0f 100644
--- a/client/client-v1/src/test/java/org/apache/atlas/AtlasAdminClientTest.java
+++ b/client/client-v1/src/test/java/org/apache/atlas/AtlasAdminClientTest.java
@@ -17,7 +17,6 @@
package org.apache.atlas;
-import com.sun.jersey.api.client.ClientResponse;
import org.apache.atlas.utils.AuthenticationUtil;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.Options;
@@ -29,6 +28,8 @@
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
+import javax.ws.rs.core.Response;
+
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintStream;
@@ -242,7 +243,7 @@ public void testAuthenticationUtilIntegration() throws Exception {
public void testPrintStandardHttpErrorDetailsWithFullException() throws Exception {
AtlasAdminClient client = new AtlasAdminClient();
AtlasServiceException exception = mock(AtlasServiceException.class);
- ClientResponse.Status status = mock(ClientResponse.Status.class);
+ Response.Status status = mock(Response.Status.class);
when(exception.getStatus()).thenReturn(status);
when(status.getStatusCode()).thenReturn(404);
when(status.getReasonPhrase()).thenReturn("Not Found");
@@ -277,7 +278,7 @@ public void testPrintStandardHttpErrorDetailsMethodSignature() throws Exception
public void testPrintStandardHttpErrorDetailsWithDifferentStatusCodes() throws Exception {
AtlasAdminClient client = new AtlasAdminClient();
AtlasServiceException exception = mock(AtlasServiceException.class);
- ClientResponse.Status status = mock(ClientResponse.Status.class);
+ Response.Status status = mock(Response.Status.class);
when(exception.getStatus()).thenReturn(status);
when(status.getStatusCode()).thenReturn(500);
when(status.getReasonPhrase()).thenReturn("Internal Server Error");
diff --git a/client/client-v1/src/test/java/org/apache/atlas/AtlasClientTest.java b/client/client-v1/src/test/java/org/apache/atlas/AtlasClientTest.java
index cc3cc9594d2..8ab02ed053d 100644
--- a/client/client-v1/src/test/java/org/apache/atlas/AtlasClientTest.java
+++ b/client/client-v1/src/test/java/org/apache/atlas/AtlasClientTest.java
@@ -17,21 +17,21 @@
package org.apache.atlas;
-import com.sun.jersey.api.client.Client;
-import com.sun.jersey.api.client.ClientHandlerException;
-import com.sun.jersey.api.client.ClientResponse;
-import com.sun.jersey.api.client.WebResource;
import org.apache.atlas.model.legacy.EntityResult;
import org.apache.atlas.type.AtlasType;
import org.apache.atlas.v1.model.instance.Referenceable;
import org.apache.commons.configuration2.Configuration;
import org.apache.hadoop.security.UserGroupInformation;
-import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.Entity;
+import javax.ws.rs.client.Invocation;
+import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriBuilder;
@@ -42,8 +42,10 @@
import java.util.Arrays;
import java.util.List;
-import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.anyObject;
+import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -55,10 +57,10 @@
public class AtlasClientTest {
@Mock
- private WebResource service;
+ private WebTarget service;
@Mock
- private WebResource.Builder resourceBuilderMock;
+ private Invocation.Builder resourceBuilderMock;
@Mock
private Configuration configuration;
@@ -68,7 +70,8 @@ public class AtlasClientTest {
@BeforeMethod
public void setup() {
- MockitoAnnotations.initMocks(this);
+ MockitoAnnotations.openMocks(this);
+ reset(service, resourceBuilderMock, client, configuration);
}
@Test
@@ -76,12 +79,12 @@ public void shouldVerifyServerIsReady() throws AtlasServiceException {
setupRetryParams();
AtlasClient atlasClient = new AtlasClient(service, configuration);
- WebResource.Builder builder = setupBuilder(AtlasClient.API_V1.VERSION, service);
- ClientResponse response = mock(ClientResponse.class);
+ Invocation.Builder builder = setupBuilder(AtlasClient.API_V1.VERSION, service);
+ Response response = mock(Response.class);
when(response.getStatus()).thenReturn(Response.Status.OK.getStatusCode());
- when(response.getEntity(String.class)).thenReturn("{\"Version\":\"version-rrelease\",\"Name\":\"apache-atlas\",\"Description\":\"Metadata Management and Data Governance Platform over Hadoop\"}");
- when(builder.method(AtlasClient.API_V1.VERSION.getMethod(), ClientResponse.class, null)).thenReturn(response);
+ when(response.readEntity(String.class)).thenReturn("{\"Version\":\"version-rrelease\",\"Name\":\"apache-atlas\",\"Description\":\"Metadata Management and Data Governance Platform over Hadoop\"}");
+ when(builder.method(anyString(), (Entity>) anyObject())).thenReturn(response);
assertTrue(atlasClient.isServerReady());
}
@@ -91,19 +94,19 @@ public void testCreateEntity() throws Exception {
setupRetryParams();
AtlasClient atlasClient = new AtlasClient(service, configuration);
- WebResource.Builder builder = setupBuilder(AtlasClient.API_V1.CREATE_ENTITY, service);
- ClientResponse response = mock(ClientResponse.class);
+ Invocation.Builder builder = setupBuilder(AtlasClient.API_V1.CREATE_ENTITY, service);
+ Response response = mock(Response.class);
when(response.getStatus()).thenReturn(Response.Status.CREATED.getStatusCode());
String jsonResponse = AtlasType.toV1Json(new EntityResult(Arrays.asList("id"), null, null));
- when(response.getEntity(String.class)).thenReturn(jsonResponse);
+ when(response.readEntity(String.class)).thenReturn(jsonResponse);
when(response.getLength()).thenReturn(jsonResponse.length());
String entityJson = AtlasType.toV1Json(new Referenceable("type"));
- when(builder.method(anyString(), ArgumentMatchers.any(), anyString())).thenReturn(response);
+ when(builder.method(anyString(), (Entity>) anyObject())).thenReturn(response);
List ids = atlasClient.createEntity(entityJson);
@@ -116,9 +119,9 @@ public void shouldReturnFalseIfServerIsNotReady() throws AtlasServiceException {
setupRetryParams();
AtlasClient atlasClient = new AtlasClient(service, configuration);
- WebResource.Builder builder = setupBuilder(AtlasClient.API_V1.VERSION, service);
-
- when(builder.method(AtlasClient.API_V1.VERSION.getMethod(), ClientResponse.class, null)).thenThrow(new ClientHandlerException());
+ Invocation.Builder builder = setupBuilder(AtlasClient.API_V1.VERSION, service);
+ when(builder.method(anyString(), (Entity>) anyObject())).thenThrow(
+ new WebApplicationException());
assertFalse(atlasClient.isServerReady());
}
@@ -127,13 +130,13 @@ public void shouldReturnFalseIfServiceIsUnavailable() throws AtlasServiceExcepti
setupRetryParams();
AtlasClient atlasClient = new AtlasClient(service, configuration);
- WebResource.Builder builder = setupBuilder(AtlasClient.API_V1.VERSION, service);
- ClientResponse response = mock(ClientResponse.class);
+ Invocation.Builder builder = setupBuilder(AtlasClient.API_V1.VERSION, service);
+ Response response = mock(Response.class);
when(response.getStatus()).thenReturn(Response.Status.SERVICE_UNAVAILABLE.getStatusCode());
- when(response.getClientResponseStatus()).thenReturn(ClientResponse.Status.SERVICE_UNAVAILABLE);
+// when(response.getResponseStatus()).thenReturn(Response.Status.SERVICE_UNAVAILABLE);
- when(builder.method(AtlasClient.API_V1.VERSION.getMethod(), ClientResponse.class, null)).thenReturn(response);
+ when(builder.method(anyString(), (Entity>) anyObject())).thenReturn(response);
assertFalse(atlasClient.isServerReady());
}
@@ -143,13 +146,13 @@ public void shouldThrowErrorIfAnyResponseOtherThanServiceUnavailable() throws At
setupRetryParams();
AtlasClient atlasClient = new AtlasClient(service, configuration);
- WebResource.Builder builder = setupBuilder(AtlasClient.API_V1.VERSION, service);
- ClientResponse response = mock(ClientResponse.class);
+ Invocation.Builder builder = setupBuilder(AtlasClient.API_V1.VERSION, service);
+ Response response = mock(Response.class);
when(response.getStatus()).thenReturn(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode());
- when(response.getClientResponseStatus()).thenReturn(ClientResponse.Status.INTERNAL_SERVER_ERROR);
+// when(response.getResponseStatus()).thenReturn(Response.Status.INTERNAL_SERVER_ERROR);
- when(builder.method(AtlasClient.API_V1.VERSION.getMethod(), ClientResponse.class, null)).thenReturn(response);
+ when(builder.method(anyString(), (Entity>) anyObject())).thenReturn(response);
atlasClient.isServerReady();
fail("Should throw exception");
@@ -160,16 +163,16 @@ public void shouldGetAdminStatus() throws AtlasServiceException {
setupRetryParams();
AtlasClient atlasClient = new AtlasClient(service, configuration);
- WebResource.Builder builder = setupBuilder(AtlasClient.API_V1.STATUS, service);
- ClientResponse response = mock(ClientResponse.class);
+ Invocation.Builder builder = setupBuilder(AtlasClient.API_V1.STATUS, service);
+ Response response = mock(Response.class);
when(response.getStatus()).thenReturn(Response.Status.OK.getStatusCode());
String activeStatus = "{\"Status\":\"Active\"}";
- when(response.getEntity(String.class)).thenReturn(activeStatus);
+ when(response.readEntity(String.class)).thenReturn(activeStatus);
when(response.getLength()).thenReturn(activeStatus.length());
- when(builder.method(AtlasClient.API_V1.STATUS.getMethod(), ClientResponse.class, null)).thenReturn(response);
+ when(builder.method(anyString(), (Entity>) anyObject())).thenReturn(response);
// Fix after AtlasBaseClient
// atlasClient.setService();
@@ -184,12 +187,12 @@ public void shouldReturnStatusAsUnknownOnException() throws AtlasServiceExceptio
setupRetryParams();
AtlasClient atlasClient = new AtlasClient(service, configuration);
- WebResource.Builder builder = setupBuilder(AtlasClient.API_V1.STATUS, service);
- ClientResponse response = mock(ClientResponse.class);
+ Invocation.Builder builder = setupBuilder(AtlasClient.API_V1.STATUS, service);
+ Response response = mock(Response.class);
when(response.getStatus()).thenReturn(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode());
- when(response.getClientResponseStatus()).thenReturn(ClientResponse.Status.INTERNAL_SERVER_ERROR);
- when(builder.method(AtlasClient.API_V1.STATUS.getMethod(), ClientResponse.class, null)).thenReturn(response);
+// when(response.getResponseStatus()).thenReturn(Response.Status.INTERNAL_SERVER_ERROR);
+ when(builder.method(anyString(), (Entity>) anyObject())).thenReturn(response);
atlasClient.getAdminStatus();
@@ -201,12 +204,12 @@ public void shouldReturnStatusAsUnknownIfJSONIsInvalid() throws AtlasServiceExce
setupRetryParams();
AtlasClient atlasClient = new AtlasClient(service, configuration);
- WebResource.Builder builder = setupBuilder(AtlasClient.API_V1.STATUS, service);
- ClientResponse response = mock(ClientResponse.class);
+ Invocation.Builder builder = setupBuilder(AtlasClient.API_V1.STATUS, service);
+ Response response = mock(Response.class);
when(response.getStatus()).thenReturn(Response.Status.OK.getStatusCode());
- when(response.getEntity(String.class)).thenReturn("{\"status\":\"Active\"}");
- when(builder.method(AtlasClient.API_V1.STATUS.getMethod(), ClientResponse.class, null)).thenReturn(response);
+ when(response.readEntity(String.class)).thenReturn("{\"status\":\"Active\"}");
+ when(builder.method(anyString(), (Entity>) anyObject())).thenReturn(response);
String status = atlasClient.getAdminStatus();
@@ -225,28 +228,28 @@ public void shouldReturnBaseURLAsPassedInURL() {
public void shouldSelectActiveAmongMultipleServersIfHAIsEnabled() {
setupRetryParams();
- when(client.resource(UriBuilder.fromUri("http://localhost:31000").build())).thenReturn(service);
- when(client.resource(UriBuilder.fromUri("http://localhost:41000").build())).thenReturn(service);
+ when(client.target(UriBuilder.fromUri("http://localhost:31000").build())).thenReturn(service);
+ when(client.target(UriBuilder.fromUri("http://localhost:41000").build())).thenReturn(service);
- WebResource.Builder builder = setupBuilder(AtlasClient.API_V1.STATUS, service);
- ClientResponse firstResponse = mock(ClientResponse.class);
+ Invocation.Builder builder = setupBuilder(AtlasClient.API_V1.STATUS, service);
+ Response firstResponse = mock(Response.class);
when(firstResponse.getStatus()).thenReturn(Response.Status.OK.getStatusCode());
String passiveStatus = "{\"Status\":\"PASSIVE\"}";
- when(firstResponse.getEntity(String.class)).thenReturn(passiveStatus);
+ when(firstResponse.readEntity(String.class)).thenReturn(passiveStatus);
when(firstResponse.getLength()).thenReturn(passiveStatus.length());
- ClientResponse secondResponse = mock(ClientResponse.class);
+ Response secondResponse = mock(Response.class);
when(secondResponse.getStatus()).thenReturn(Response.Status.OK.getStatusCode());
String activeStatus = "{\"Status\":\"ACTIVE\"}";
- when(secondResponse.getEntity(String.class)).thenReturn(activeStatus);
+ when(secondResponse.readEntity(String.class)).thenReturn(activeStatus);
when(secondResponse.getLength()).thenReturn(activeStatus.length());
- when(builder.method(AtlasClient.API_V1.STATUS.getMethod(), ClientResponse.class, null))
+ when(builder.method(anyString(), (Entity>) anyObject()))
.thenReturn(firstResponse).thenReturn(firstResponse).thenReturn(firstResponse)
.thenReturn(secondResponse);
@@ -260,26 +263,34 @@ public void shouldSelectActiveAmongMultipleServersIfHAIsEnabled() {
public void shouldRetryUntilServiceBecomesActive() {
setupRetryParams();
- when(client.resource(UriBuilder.fromUri("http://localhost:31000").build())).thenReturn(service);
+ when(client.target(UriBuilder.fromUri("http://localhost:31000").build())).thenReturn(service);
+ when(client.target(UriBuilder.fromUri("http://localhost:41000").build())).thenReturn(service);
- WebResource.Builder builder = setupBuilder(AtlasClient.API_V1.STATUS, service);
- ClientResponse response = mock(ClientResponse.class);
+ Invocation.Builder builder = setupBuilder(AtlasClient.API_V1.STATUS, service);
+ Response response = mock(Response.class);
when(response.getStatus()).thenReturn(Response.Status.OK.getStatusCode());
- when(response.getEntity(String.class)).thenReturn("{\"Status\":\"BECOMING_ACTIVE\"}");
+ when(response.readEntity(String.class)).thenReturn("{\"Status\":\"BECOMING_ACTIVE\"}");
+ when(response.getLength()).thenReturn("{\"Status\":\"BECOMING_ACTIVE\"}".length());
- ClientResponse nextResponse = mock(ClientResponse.class);
+ Response nextResponse = mock(Response.class);
when(nextResponse.getStatus()).thenReturn(Response.Status.OK.getStatusCode());
String activeStatus = "{\"Status\":\"ACTIVE\"}";
- when(response.getEntity(String.class)).thenReturn(activeStatus);
- when(response.getLength()).thenReturn(activeStatus.length());
- when(builder.method(AtlasClient.API_V1.STATUS.getMethod(), ClientResponse.class, null))
- .thenReturn(response).thenReturn(response).thenReturn(nextResponse);
+ when(nextResponse.readEntity(String.class)).thenReturn(activeStatus);
+ when(nextResponse.getLength()).thenReturn(activeStatus.length());
+ when(builder.method(anyString(), (Entity>) anyObject()))
+ .thenThrow(new WebApplicationException("Simulating connection exception"))
+ .thenReturn(response)
+ .thenReturn(nextResponse);
AtlasClient atlasClient = new AtlasClient(service, configuration);
+
+ atlasClient.setService(service);
+ atlasClient.setConfiguration(configuration);
+
String serviceURL = atlasClient.determineActiveServiceURL(new String[] {"http://localhost:31000", "http://localhost:41000"}, client);
assertEquals(serviceURL, "http://localhost:31000");
@@ -289,24 +300,24 @@ public void shouldRetryUntilServiceBecomesActive() {
public void shouldRetryIfCannotConnectToServiceInitially() {
setupRetryParams();
- when(client.resource(UriBuilder.fromUri("http://localhost:31000").build())).thenReturn(service);
+ when(client.target(UriBuilder.fromUri("http://localhost:31000").build())).thenReturn(service);
- WebResource.Builder builder = setupBuilder(AtlasClient.API_V1.STATUS, service);
- ClientResponse response = mock(ClientResponse.class);
+ Invocation.Builder builder = setupBuilder(AtlasClient.API_V1.STATUS, service);
+ Response response = mock(Response.class);
when(response.getStatus()).thenReturn(Response.Status.OK.getStatusCode());
- when(response.getEntity(String.class)).thenReturn("{\"Status\":\"BECOMING_ACTIVE\"}");
+ when(response.readEntity(String.class)).thenReturn("{\"Status\":\"BECOMING_ACTIVE\"}");
- ClientResponse nextResponse = mock(ClientResponse.class);
+ Response nextResponse = mock(Response.class);
when(nextResponse.getStatus()).thenReturn(Response.Status.OK.getStatusCode());
String activeStatus = "{\"Status\":\"ACTIVE\"}";
- when(response.getEntity(String.class)).thenReturn(activeStatus);
+ when(response.readEntity(String.class)).thenReturn(activeStatus);
when(response.getLength()).thenReturn(activeStatus.length());
- when(builder.method(AtlasClient.API_V1.STATUS.getMethod(), ClientResponse.class, null))
- .thenThrow(new ClientHandlerException("Simulating connection exception"))
+ when(builder.method(anyString(), (Entity>) anyObject()))
+ .thenThrow(new WebApplicationException("Simulating connection exception"))
.thenReturn(response)
.thenReturn(nextResponse);
@@ -324,15 +335,15 @@ public void shouldRetryIfCannotConnectToServiceInitially() {
public void shouldThrowExceptionIfActiveServerIsNotFound() {
setupRetryParams();
- when(client.resource(UriBuilder.fromUri("http://localhost:31000").build())).thenReturn(service);
+ when(client.target(UriBuilder.fromUri("http://localhost:31000").build())).thenReturn(service);
- WebResource.Builder builder = setupBuilder(AtlasClient.API_V1.STATUS, service);
- ClientResponse response = mock(ClientResponse.class);
+ Invocation.Builder builder = setupBuilder(AtlasClient.API_V1.STATUS, service);
+ Response response = mock(Response.class);
when(response.getStatus()).thenReturn(Response.Status.OK.getStatusCode());
- when(response.getEntity(String.class)).thenReturn("{\"Status\":\"BECOMING_ACTIVE\"}");
- when(builder.method(AtlasClient.API_V1.STATUS.getMethod(), ClientResponse.class, null))
- .thenThrow(new ClientHandlerException("Simulating connection exception"))
+ when(response.readEntity(String.class)).thenReturn("{\"Status\":\"BECOMING_ACTIVE\"}");
+ when(builder.method(anyString(), (Entity>) anyObject()))
+ .thenThrow(new WebApplicationException("Simulating connection exception"))
.thenReturn(response)
.thenReturn(response);
@@ -347,25 +358,25 @@ public void shouldRetryAPICallsOnClientHandlerException() throws AtlasServiceExc
setupRetryParams();
ResourceCreator resourceCreator = mock(ResourceCreator.class);
- WebResource resourceObject = mock(WebResource.class);
+ WebTarget resourceObject = mock(WebTarget.class);
- when(resourceObject.getURI())
+ when(resourceObject.getUri())
.thenReturn(new URI("http://localhost:31000/api/atlas/types"))
.thenReturn(new URI("http://localhost:41000/api/atlas/types"))
.thenReturn(new URI("http://localhost:41000/api/atlas/types"));
- WebResource.Builder builder = getBuilder(resourceObject);
- ClientResponse response = mock(ClientResponse.class);
+ Invocation.Builder builder = getBuilder(resourceObject);
+ Response response = mock(Response.class);
when(response.getStatus()).thenReturn(Response.Status.OK.getStatusCode());
String activeStatus = "{\"Status\":\"ACTIVE\"}";
- when(response.getEntity(String.class)).thenReturn(activeStatus);
+ when(response.readEntity(String.class)).thenReturn(activeStatus);
when(response.getLength()).thenReturn(activeStatus.length());
- when(builder.method(AtlasClient.API_V1.LIST_TYPES.getMethod(), ClientResponse.class, null))
- .thenThrow(new ClientHandlerException("simulating exception in calling API", new ConnectException()))
+ when(builder.method(anyString(), (Entity>) anyObject()))
+ .thenThrow(new WebApplicationException("simulating exception in calling API", new ConnectException()))
.thenReturn(response);
when(resourceCreator.createResource()).thenReturn(resourceObject);
@@ -377,9 +388,9 @@ public void shouldRetryAPICallsOnClientHandlerException() throws AtlasServiceExc
atlasClient.callAPIWithRetries(AtlasClient.API_V1.LIST_TYPES, null, resourceCreator);
- verify(client).destroy();
- verify(client).resource(UriBuilder.fromUri("http://localhost:31000").build());
- verify(client).resource(UriBuilder.fromUri("http://localhost:41000").build());
+ verify(client).close();
+ verify(client).target(UriBuilder.fromUri("http://localhost:31000").build());
+ verify(client).target(UriBuilder.fromUri("http://localhost:41000").build());
}
@Test
@@ -387,23 +398,23 @@ public void shouldRetryWithSameClientIfSingleAddressIsUsed() throws URISyntaxExc
setupRetryParams();
ResourceCreator resourceCreator = mock(ResourceCreator.class);
- WebResource resourceObject = mock(WebResource.class);
+ WebTarget resourceObject = mock(WebTarget.class);
- when(resourceObject.getURI()).thenReturn(new URI("http://localhost:31000/api/atlas/types"));
+ when(resourceObject.getUri()).thenReturn(new URI("http://localhost:31000/api/atlas/types"));
- WebResource.Builder builder = getBuilder(resourceObject);
+ Invocation.Builder builder = getBuilder(resourceObject);
- ClientResponse response = mock(ClientResponse.class);
+ Response response = mock(Response.class);
when(response.getStatus()).thenReturn(Response.Status.OK.getStatusCode());
String activeStatus = "{\"Status\":\"ACTIVE\"}";
- when(response.getEntity(String.class)).thenReturn(activeStatus);
+ when(response.readEntity(String.class)).thenReturn(activeStatus);
when(response.getLength()).thenReturn(activeStatus.length());
- when(builder.method(AtlasClient.API_V1.LIST_TYPES.getMethod(), ClientResponse.class, null))
- .thenThrow(new ClientHandlerException("simulating exception in calling API", new ConnectException()))
+ when(builder.method(anyString(), (Entity>) anyObject()))
+ .thenThrow(new WebApplicationException("simulating exception in calling API", new ConnectException()))
.thenReturn(response);
when(resourceCreator.createResource()).thenReturn(resourceObject);
@@ -416,8 +427,8 @@ public void shouldRetryWithSameClientIfSingleAddressIsUsed() throws URISyntaxExc
atlasClient.callAPIWithRetries(AtlasClient.API_V1.LIST_TYPES, null, resourceCreator);
- verify(client).destroy();
- verify(client, times(2)).resource(UriBuilder.fromUri("http://localhost:31000").build());
+ verify(client).close();
+ verify(client, times(2)).target(UriBuilder.fromUri("http://localhost:31000").build());
}
@Test
@@ -425,31 +436,31 @@ public void shouldRetryAPICallsOnServiceUnavailable() throws AtlasServiceExcepti
setupRetryParams();
ResourceCreator resourceCreator = mock(ResourceCreator.class);
- WebResource resourceObject = mock(WebResource.class);
+ WebTarget resourceObject = mock(WebTarget.class);
- when(resourceObject.getURI())
+ when(resourceObject.getUri())
.thenReturn(new URI("http://localhost:31000/api/atlas/types"))
.thenReturn(new URI("http://localhost:41000/api/atlas/types"))
.thenReturn(new URI("http://localhost:41000/api/atlas/types"));
- WebResource.Builder builder = getBuilder(resourceObject);
+ Invocation.Builder builder = getBuilder(resourceObject);
- ClientResponse firstResponse = mock(ClientResponse.class);
+ Response firstResponse = mock(Response.class);
when(firstResponse.getStatus()).thenReturn(Response.Status.SERVICE_UNAVAILABLE.getStatusCode());
- when(firstResponse.getClientResponseStatus()).thenReturn(ClientResponse.Status.SERVICE_UNAVAILABLE);
+// when(firstResponse.getResponseStatus()).thenReturn(Response.Status.SERVICE_UNAVAILABLE);
- ClientResponse response = mock(ClientResponse.class);
+ Response response = mock(Response.class);
when(response.getStatus()).thenReturn(Response.Status.OK.getStatusCode());
String activeStatus = "{\"Status\":\"ACTIVE\"}";
- when(response.getEntity(String.class)).thenReturn(activeStatus);
+ when(response.readEntity(String.class)).thenReturn(activeStatus);
when(response.getLength()).thenReturn(activeStatus.length());
- when(builder.method(AtlasClient.API_V1.LIST_TYPES.getMethod(), ClientResponse.class, null))
- .thenThrow(new ClientHandlerException("simulating exception in calling API", new ConnectException()))
+ when(builder.method(anyString(), (Entity>) anyObject()))
+ .thenThrow(new WebApplicationException("simulating exception in calling API", new ConnectException()))
.thenReturn(firstResponse)
.thenReturn(response);
@@ -462,26 +473,23 @@ public void shouldRetryAPICallsOnServiceUnavailable() throws AtlasServiceExcepti
atlasClient.callAPIWithRetries(AtlasClient.API_V1.LIST_TYPES, null, resourceCreator);
- verify(client).destroy();
- verify(client).resource(UriBuilder.fromUri("http://localhost:31000").build());
- verify(client).resource(UriBuilder.fromUri("http://localhost:41000").build());
+ verify(client).close();
+ verify(client).target(UriBuilder.fromUri("http://localhost:31000").build());
+ verify(client).target(UriBuilder.fromUri("http://localhost:41000").build());
}
- private WebResource.Builder setupBuilder(AtlasClient.API_V1 api, WebResource webResource) {
+ private Invocation.Builder setupBuilder(AtlasClient.API_V1 api, WebTarget webResource) {
when(webResource.path(api.getPath())).thenReturn(service);
when(webResource.path(api.getNormalizedPath())).thenReturn(service);
return getBuilder(service);
}
- private WebResource.Builder getBuilder(WebResource resourceObject) {
- when(resourceObject.getRequestBuilder()).thenReturn(resourceBuilderMock);
+ private Invocation.Builder getBuilder(WebTarget resourceObject) {
+ when(resourceObject.request()).thenReturn(resourceBuilderMock);
when(resourceObject.path(anyString())).thenReturn(resourceObject);
when(resourceBuilderMock.accept(AtlasBaseClient.JSON_MEDIA_TYPE)).thenReturn(resourceBuilderMock);
when(resourceBuilderMock.accept(MediaType.APPLICATION_JSON)).thenReturn(resourceBuilderMock);
- when(resourceBuilderMock.type(AtlasBaseClient.JSON_MEDIA_TYPE)).thenReturn(resourceBuilderMock);
- when(resourceBuilderMock.type(MediaType.MULTIPART_FORM_DATA)).thenReturn(resourceBuilderMock);
-
return resourceBuilderMock;
}
diff --git a/client/client-v2-shaded/pom.xml b/client/client-v2-shaded/pom.xml
new file mode 100644
index 00000000000..cce6e13b926
--- /dev/null
+++ b/client/client-v2-shaded/pom.xml
@@ -0,0 +1,117 @@
+
+
+
+ 4.0.0
+
+
+ org.apache.atlas
+ atlas-client
+ 3.0.0-SNAPSHOT
+
+
+ atlas-client-v2-shaded
+
+
+
+ org.apache.atlas
+ atlas-client-common
+ ${project.version}
+
+
+
+ org.apache.atlas
+ atlas-client-v2
+
+
+ org.glassfish.jersey.inject
+ jersey-hk2
+ ${jersey2.version}
+
+
+ org.glassfish.jersey.media
+ jersey-media-json-jackson
+ ${jersey2.version}
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-remote-resources-plugin
+
+ true
+
+
+
+ org.apache.maven.plugins
+ maven-shade-plugin
+ ${maven-shade-plugin.version}
+
+
+
+ shade
+
+ package
+
+ false
+
+
+ jakarta.ws.rs:jakarta.ws.rs-api
+ org.glassfish.jersey.media:jersey-media-multipart
+ org.glassfish.jersey.core:jersey-common
+ org.glassfish.jersey.core:jersey-client
+ org.glassfish.jersey.media:jersey-media-json-jackson
+ org.glassfish.jersey.ext:jersey-entity-filtering
+ org.glassfish.jersey.inject:jersey-hk2
+ org.apache.atlas:*
+
+
+ org.apache.atlas:atlas-intg
+
+
+
+
+ *:*
+
+ META-INF/maven/**
+ META-INF/*
+
+
+
+
+
+ javax.ws.rs
+ org.apache.atlas.shaded.javax.ws.rs
+
+
+
+
+
+
+
+
+
+
diff --git a/client/client-v2/src/main/java/org/apache/atlas/AtlasClientV2.java b/client/client-v2/src/main/java/org/apache/atlas/AtlasClientV2.java
index a46a6724a6a..43d0732e446 100644
--- a/client/client-v2/src/main/java/org/apache/atlas/AtlasClientV2.java
+++ b/client/client-v2/src/main/java/org/apache/atlas/AtlasClientV2.java
@@ -20,15 +20,6 @@
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.google.common.annotations.VisibleForTesting;
-import com.sun.jersey.api.client.GenericType;
-import com.sun.jersey.api.client.WebResource;
-import com.sun.jersey.core.header.FormDataContentDisposition;
-import com.sun.jersey.core.util.MultivaluedMapImpl;
-import com.sun.jersey.multipart.BodyPart;
-import com.sun.jersey.multipart.FormDataBodyPart;
-import com.sun.jersey.multipart.FormDataMultiPart;
-import com.sun.jersey.multipart.MultiPart;
-import com.sun.jersey.multipart.file.StreamDataBodyPart;
import org.apache.atlas.bulkimport.BulkImportResponse;
import org.apache.atlas.model.PList;
import org.apache.atlas.model.SearchFilter;
@@ -77,17 +68,23 @@
import org.apache.commons.configuration2.Configuration;
import org.apache.commons.lang3.StringUtils;
import org.apache.hadoop.security.UserGroupInformation;
+import org.glassfish.jersey.media.multipart.FormDataBodyPart;
+import org.glassfish.jersey.media.multipart.FormDataMultiPart;
+import org.glassfish.jersey.media.multipart.MultiPart;
+import org.glassfish.jersey.media.multipart.file.FileDataBodyPart;
+import org.glassfish.jersey.media.multipart.file.StreamDataBodyPart;
import javax.ws.rs.HttpMethod;
+import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.Cookie;
+import javax.ws.rs.core.GenericType;
import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedHashMap;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;
import java.io.BufferedReader;
import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
@@ -192,7 +189,7 @@ public AtlasClientV2(Configuration configuration, String[] baseUrl, String[] bas
}
@VisibleForTesting
- public AtlasClientV2(WebResource service, Configuration configuration) {
+ public AtlasClientV2(WebTarget service, Configuration configuration) {
super(service, configuration);
}
@@ -356,7 +353,7 @@ public void deleteAtlasTypeDefs(AtlasTypesDef typesDef, boolean forceDelete) thr
MultivaluedMap queryParams = null;
if (forceDelete) {
- queryParams = new MultivaluedMapImpl();
+ queryParams = new MultivaluedHashMap();
queryParams.add("force", "true");
}
@@ -371,7 +368,7 @@ public void deleteTypeByName(String typeName, boolean forceDelete) throws AtlasS
MultivaluedMap queryParams = null;
if (forceDelete) {
- queryParams = new MultivaluedMapImpl();
+ queryParams = new MultivaluedHashMap();
queryParams.add("force", "true");
}
@@ -384,7 +381,7 @@ public AtlasEntityWithExtInfo getEntityByGuid(String guid) throws AtlasServiceEx
}
public AtlasEntityWithExtInfo getEntityByGuid(String guid, boolean minExtInfo, boolean ignoreRelationships) throws AtlasServiceException {
- MultivaluedMap queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
queryParams.add("minExtInfo", String.valueOf(minExtInfo));
queryParams.add("ignoreRelationships", String.valueOf(ignoreRelationships));
@@ -410,7 +407,7 @@ public AtlasEntitiesWithExtInfo getEntitiesByGuids(List guids) throws At
}
public AtlasEntitiesWithExtInfo getEntitiesByGuids(List guids, boolean minExtInfo, boolean ignoreRelationships) throws AtlasServiceException {
- MultivaluedMap queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
queryParams.put("guid", guids);
queryParams.add("minExtInfo", String.valueOf(minExtInfo));
@@ -443,7 +440,7 @@ public AtlasEntityHeader getEntityHeaderByAttribute(String typeName, Map getAuditEvents(String guid, String startKey, EntityAuditEventV2.EntityAuditActionV2 auditAction, short count) throws AtlasServiceException {
- MultivaluedMap queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
queryParams.add("startKey", startKey);
@@ -479,7 +476,7 @@ public EntityMutationResponse updateEntityByAttribute(String typeName, Map queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
queryParams.add("name", attrName);
@@ -562,7 +559,7 @@ public void removeClassification(String typeName, Map uniqAttrib
}
public AtlasEntityHeaders getEntityHeaders(long tagUpdateStartTime) throws AtlasServiceException {
- MultivaluedMap queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
queryParams.add("tagUpdateStartTime", Long.toString(tagUpdateStartTime));
@@ -571,7 +568,7 @@ public AtlasEntityHeaders getEntityHeaders(long tagUpdateStartTime) throws Atlas
// Business attributes APIs
public void addOrUpdateBusinessAttributes(String entityGuid, boolean isOverwrite, Map> businessAttributes) throws AtlasServiceException {
- MultivaluedMap queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
queryParams.add("isOverwrite", String.valueOf(isOverwrite));
@@ -635,7 +632,7 @@ public void setLabels(String typeName, Map uniqAttributes, Set queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
queryParams.add("direction", direction.toString());
queryParams.add("depth", String.valueOf(depth));
@@ -658,7 +655,7 @@ public AtlasLineageInfo getLineageInfoOnDemand(String guid, Map queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
queryParams.add(QUERY, query);
@@ -666,7 +663,7 @@ public AtlasSearchResult dslSearch(String query) throws AtlasServiceException {
}
public AtlasSearchResult dslSearchWithParams(String query, int limit, int offset) throws AtlasServiceException {
- MultivaluedMap queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
queryParams.add(QUERY, query);
queryParams.add(LIMIT, String.valueOf(limit));
@@ -676,7 +673,7 @@ public AtlasSearchResult dslSearchWithParams(String query, int limit, int offset
}
public AtlasSearchResult fullTextSearch(String query) throws AtlasServiceException {
- MultivaluedMap queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
queryParams.add(QUERY, query);
@@ -684,7 +681,7 @@ public AtlasSearchResult fullTextSearch(String query) throws AtlasServiceExcepti
}
public AtlasSearchResult fullTextSearchWithParams(String query, int limit, int offset) throws AtlasServiceException {
- MultivaluedMap queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
queryParams.add(QUERY, query);
queryParams.add(LIMIT, String.valueOf(limit));
@@ -719,7 +716,7 @@ public AtlasSearchResult facetedSearch(SearchParameters searchParameters) throws
}
public AtlasSearchResult attributeSearch(String typeName, String attrName, String attrValuePrefix, int limit, int offset) throws AtlasServiceException {
- MultivaluedMap queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
queryParams.add("attrName", attrName);
queryParams.add("attrValuePrefix", attrValuePrefix);
@@ -731,7 +728,7 @@ public AtlasSearchResult attributeSearch(String typeName, String attrName, Strin
}
public AtlasSearchResult relationshipSearch(String guid, String relation, String sortByAttribute, SortOrder sortOrder, boolean excludeDeletedEntities, int limit, int offset) throws AtlasServiceException {
- MultivaluedMap queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
queryParams.add("guid", guid);
queryParams.add("relation", relation);
@@ -749,7 +746,7 @@ public AtlasSearchResult relationshipSearch(String guid, String relation, String
}
public AtlasQuickSearchResult quickSearch(String query, String typeName, boolean excludeDeletedEntities, int limit, int offset) throws AtlasServiceException {
- MultivaluedMap queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
queryParams.add("query", query);
queryParams.add("typeName", typeName);
@@ -766,7 +763,7 @@ public AtlasQuickSearchResult quickSearch(QuickSearchParameters quickSearchParam
// fieldName should be the parameter on which indexing is enabled such as "qualifiedName"
public AtlasSuggestionsResult getSuggestions(String prefixString, String fieldName) throws AtlasServiceException {
- MultivaluedMap queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
if (StringUtils.isNotEmpty(prefixString)) {
queryParams.add("prefixString", prefixString);
@@ -780,7 +777,7 @@ public AtlasSuggestionsResult getSuggestions(String prefixString, String fieldNa
}
public List getSavedSearches(String userName) throws AtlasServiceException {
- MultivaluedMap queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
queryParams.add("user", userName);
@@ -788,7 +785,7 @@ public List getSavedSearches(String userName) throws Atlas
}
public AtlasUserSavedSearch getSavedSearch(String userName, String searchName) throws AtlasServiceException {
- MultivaluedMap queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
queryParams.add("user", userName);
@@ -808,7 +805,7 @@ public void deleteSavedSearch(String guid) throws AtlasServiceException {
}
public AtlasSearchResult executeSavedSearch(String userName, String searchName) throws AtlasServiceException {
- MultivaluedMap queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
queryParams.add("user", userName);
@@ -825,7 +822,7 @@ public AtlasRelationshipWithExtInfo getRelationshipByGuid(String guid) throws At
}
public AtlasRelationshipWithExtInfo getRelationshipByGuid(String guid, boolean extendedInfo) throws AtlasServiceException {
- MultivaluedMap queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
queryParams.add("extendedInfo", String.valueOf(extendedInfo));
@@ -857,7 +854,7 @@ AtlasAuditEntry extractElement(ObjectNode element) {
}
public void ageoutAtlasAudits(AuditReductionCriteria auditReductionCriteria, boolean useAuditConfig) throws AtlasServiceException {
- MultivaluedMap queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
queryParams.add("useAuditConfig", String.valueOf(useAuditConfig));
@@ -866,7 +863,7 @@ public void ageoutAtlasAudits(AuditReductionCriteria auditReductionCriteria, boo
// Glossary APIs
public List getAllGlossaries(String sortByAttribute, int limit, int offset) throws AtlasServiceException {
- MultivaluedMap queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
queryParams.add("sort", sortByAttribute);
queryParams.add(LIMIT, String.valueOf(limit));
@@ -888,7 +885,7 @@ public AtlasGlossaryTerm getGlossaryTerm(String termGuid) throws AtlasServiceExc
}
public List getGlossaryTerms(String glossaryGuid, String sortByAttribute, int limit, int offset) throws AtlasServiceException {
- MultivaluedMap queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
queryParams.add("glossaryGuid", glossaryGuid);
queryParams.add(LIMIT, String.valueOf(limit));
@@ -899,7 +896,7 @@ public List getGlossaryTerms(String glossaryGuid, String sort
}
public List getGlossaryTermHeaders(String glossaryGuid, String sortByAttribute, int limit, int offset) throws AtlasServiceException {
- MultivaluedMap queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
queryParams.add("glossaryGuid", glossaryGuid);
queryParams.add(LIMIT, String.valueOf(limit));
@@ -914,7 +911,7 @@ public AtlasGlossaryCategory getGlossaryCategory(String categoryGuid) throws Atl
}
public List getGlossaryCategories(String glossaryGuid, String sortByAttribute, int limit, int offset) throws AtlasServiceException {
- MultivaluedMap queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
queryParams.add("glossaryGuid", glossaryGuid);
queryParams.add(LIMIT, String.valueOf(limit));
@@ -925,7 +922,7 @@ public List getGlossaryCategories(String glossaryGuid, St
}
public List getGlossaryCategoryHeaders(String glossaryGuid, String sortByAttribute, int limit, int offset) throws AtlasServiceException {
- MultivaluedMap queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
queryParams.add("glossaryGuid", glossaryGuid);
queryParams.add(LIMIT, String.valueOf(limit));
@@ -936,7 +933,7 @@ public List getGlossaryCategoryHeaders(String glossa
}
public List getCategoryTerms(String categoryGuid, String sortByAttribute, int limit, int offset) throws AtlasServiceException {
- MultivaluedMap queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
queryParams.add("categoryGuid", categoryGuid);
queryParams.add(LIMIT, String.valueOf(limit));
@@ -947,7 +944,7 @@ public List getCategoryTerms(String categoryGuid, String
}
public Map> getRelatedTerms(String termGuid, String sortByAttribute, int limit, int offset) throws AtlasServiceException {
- MultivaluedMap queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
queryParams.add("termGuid", termGuid);
queryParams.add(LIMIT, String.valueOf(limit));
@@ -958,7 +955,7 @@ public Map> getRelatedTe
}
public Map> getRelatedCategories(String categoryGuid, String sortByAttribute, int limit, int offset) throws AtlasServiceException {
- MultivaluedMap queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
queryParams.add(LIMIT, String.valueOf(limit));
queryParams.add(OFFSET, String.valueOf(offset));
@@ -1024,7 +1021,7 @@ public void deleteGlossaryCategoryByGuid(String categoryGuid) throws AtlasServic
}
public List getEntitiesAssignedWithTerm(String termGuid, String sortByAttribute, int limit, int offset) throws AtlasServiceException {
- MultivaluedMap queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
queryParams.add("termGuid", termGuid);
queryParams.add(LIMIT, String.valueOf(limit));
@@ -1063,7 +1060,7 @@ public Map getIndexRecoveryData() throws AtlasServiceException {
}
public void startIndexRecovery(Instant startTime) throws AtlasServiceException {
- MultivaluedMap queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
queryParams.add("startTime", startTime != null ? String.valueOf(startTime) : null);
@@ -1092,7 +1089,7 @@ public PList getAsyncImportStatus(Integer offset, Integer lim
int actualOffset = (offset != null) ? offset : 0;
int actualLimit = (limit != null) ? limit : 50;
- MultivaluedMap queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
queryParams.add("offset", String.valueOf(actualOffset));
queryParams.add("limit", String.valueOf(actualLimit));
@@ -1132,15 +1129,8 @@ protected String getPathForType(Class typeDefClass) {
}
private MultiPart getMultiPartData(String fileName) throws AtlasServiceException {
- try {
- File file = new File(fileName);
- InputStream inputStream = new FileInputStream(file);
- final FormDataContentDisposition fd = FormDataContentDisposition.name("file").fileName(file.getName()).build();
-
- return new FormDataMultiPart().bodyPart(new StreamDataBodyPart("file", inputStream)).bodyPart(new FormDataBodyPart(fd, "file"));
- } catch (FileNotFoundException e) {
- throw new AtlasServiceException(e);
- }
+ File file = new File(fileName);
+ return new FormDataMultiPart().bodyPart(new FileDataBodyPart("file", file));
}
private String readStreamContents(InputStream inputStream) throws AtlasServiceException {
@@ -1178,7 +1168,7 @@ private MultivaluedMap attributesToQueryParams(Map attributesToQueryParams(Map attributes, MultivaluedMap queryParams) {
if (queryParams == null) {
- queryParams = new MultivaluedMapImpl();
+ queryParams = new MultivaluedHashMap<>();
}
if (MapUtils.isNotEmpty(attributes)) {
@@ -1192,7 +1182,7 @@ private MultivaluedMap attributesToQueryParams(Map attributesToQueryParams(List
- com.sun.jersey.contribs
- jersey-multipart
+ org.glassfish.jersey.media
+ jersey-media-multipart
+ ${jersey2.version}
diff --git a/common/pom.xml b/common/pom.xml
index 5e351817bc1..e9a99a61988 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -74,6 +74,10 @@
org.apache.hadoop
hadoop-common
+
+ com.sun.jersey
+ *
+
javax.servlet
servlet-api
diff --git a/common/src/test/resources/atlas-logback.xml b/common/src/test/resources/atlas-logback.xml
index d82bfa8c308..77be557574a 100644
--- a/common/src/test/resources/atlas-logback.xml
+++ b/common/src/test/resources/atlas-logback.xml
@@ -44,7 +44,7 @@
-
+
diff --git a/dev-support/atlas-docker/scripts/atlas-build.sh b/dev-support/atlas-docker/scripts/atlas-build.sh
index bc8c9032de6..f1baf38c9e4 100755
--- a/dev-support/atlas-docker/scripts/atlas-build.sh
+++ b/dev-support/atlas-docker/scripts/atlas-build.sh
@@ -99,7 +99,7 @@ else
done
fi
-mvn ${ARG_PROFILES} ${ARG_SKIPTESTS} -DskipDocs clean verify --no-transfer-progress -B -V
+mvn ${ARG_PROFILES} ${ARG_SKIPTESTS} -Drat.skip=true -DskipDocs clean verify --no-transfer-progress -B -V
status=$?
diff --git a/distro/pom.xml b/distro/pom.xml
index d7e95888949..449a669a013 100644
--- a/distro/pom.xml
+++ b/distro/pom.xml
@@ -124,6 +124,16 @@ atlas.graph.storage.hbase.regions-per-server=1
hbase-bridge
${project.version}
provided
+
+
+ com.sun.jersey
+ *
+
+
+ com.sun.jersey.contribs
+ *
+
+
diff --git a/distro/src/conf/atlas-logback.xml b/distro/src/conf/atlas-logback.xml
index 2e305611167..9046367a911 100755
--- a/distro/src/conf/atlas-logback.xml
+++ b/distro/src/conf/atlas-logback.xml
@@ -142,7 +142,7 @@
-
+
diff --git a/intg/pom.xml b/intg/pom.xml
index 35b0f2f45a8..4ba1612987e 100644
--- a/intg/pom.xml
+++ b/intg/pom.xml
@@ -82,6 +82,10 @@
org.apache.hadoop
hadoop-common
+
+ com.sun.jersey
+ *
+
io.netty
netty-handler
diff --git a/intg/src/main/java/org/apache/atlas/model/SearchFilter.java b/intg/src/main/java/org/apache/atlas/model/SearchFilter.java
index 97967968e5d..81494cbcd5d 100644
--- a/intg/src/main/java/org/apache/atlas/model/SearchFilter.java
+++ b/intg/src/main/java/org/apache/atlas/model/SearchFilter.java
@@ -20,8 +20,8 @@
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
-import com.sun.jersey.core.util.MultivaluedMapImpl;
+import javax.ws.rs.core.MultivaluedHashMap;
import javax.ws.rs.core.MultivaluedMap;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
@@ -95,7 +95,7 @@ public List getParams(String name) {
public void setParam(String name, String value) {
if (name != null) {
if (params == null) {
- params = new MultivaluedMapImpl();
+ params = new MultivaluedHashMap();
}
params.add(name, value);
@@ -105,7 +105,7 @@ public void setParam(String name, String value) {
public void setParam(String name, List values) {
if (name != null) {
if (params == null) {
- params = new MultivaluedMapImpl();
+ params = new MultivaluedHashMap();
}
params.put(name, values);
}
diff --git a/intg/src/main/resources/atlas-logback.xml b/intg/src/main/resources/atlas-logback.xml
index 74052748260..ea86fb91352 100755
--- a/intg/src/main/resources/atlas-logback.xml
+++ b/intg/src/main/resources/atlas-logback.xml
@@ -83,7 +83,7 @@
-
+
diff --git a/notification/src/test/java/org/apache/atlas/notification/RestNotificationTest.java b/notification/src/test/java/org/apache/atlas/notification/RestNotificationTest.java
index 147f7e62406..c3cf2489658 100644
--- a/notification/src/test/java/org/apache/atlas/notification/RestNotificationTest.java
+++ b/notification/src/test/java/org/apache/atlas/notification/RestNotificationTest.java
@@ -18,8 +18,6 @@
package org.apache.atlas.notification;
-import com.sun.jersey.api.client.ClientResponse;
-import com.sun.jersey.api.client.WebResource;
import org.apache.atlas.ApplicationProperties;
import org.apache.atlas.AtlasBaseClient;
import org.apache.atlas.AtlasClientV2;
@@ -28,12 +26,14 @@
import org.apache.atlas.kafka.NotificationProvider;
import org.apache.atlas.notification.rest.RestNotification;
import org.apache.commons.configuration2.Configuration;
-import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
+import javax.ws.rs.client.Entity;
+import javax.ws.rs.client.Invocation;
+import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
@@ -41,8 +41,8 @@
import java.util.Collections;
import static org.apache.atlas.kafka.KafkaNotification.ATLAS_HOOK_TOPIC;
-import static org.mockito.ArgumentMatchers.anyList;
import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.Matchers.anyObject;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import static org.testng.Assert.assertEquals;
@@ -54,10 +54,10 @@ public class RestNotificationTest {
private Configuration conf;
@Mock
- private WebResource service;
+ private WebTarget service;
@Mock
- private WebResource.Builder resourceBuilderMock;
+ private Invocation.Builder resourceBuilderMock;
@BeforeClass
public void setup() throws Exception {
@@ -80,11 +80,11 @@ public void testNotificationProvider() {
public void testPostNotificationToTopic() {
AtlasClientV2 client = new AtlasClientV2(service, conf);
AtlasBaseClient.API api = client.formatPathWithParameter(AtlasClientV2.API_V2.POST_NOTIFICATIONS_TO_TOPIC, ATLAS_HOOK_TOPIC);
- WebResource.Builder builder = setupBuilder(api, service);
- ClientResponse response = mock(ClientResponse.class);
+ Invocation.Builder builder = setupBuilder(api, service);
+ Response response = mock(Response.class);
when(response.getStatus()).thenReturn(Response.Status.NO_CONTENT.getStatusCode());
- when(builder.method(anyString(), ArgumentMatchers.>any(), anyList())).thenReturn(response);
+ when(builder.method(anyString(), (Entity>) anyObject())).thenReturn(response);
((RestNotification) notifier).atlasClientV2 = client;
@@ -99,12 +99,12 @@ public void testPostNotificationToTopic() {
public void testNotificationException() {
AtlasClientV2 client = new AtlasClientV2(service, conf);
AtlasBaseClient.API api = client.formatPathWithParameter(AtlasClientV2.API_V2.POST_NOTIFICATIONS_TO_TOPIC, ATLAS_HOOK_TOPIC);
- WebResource.Builder builder = setupBuilder(api, service);
- ClientResponse response = mock(ClientResponse.class);
+ Invocation.Builder builder = setupBuilder(api, service);
+ Response response = mock(Response.class);
when(response.getStatus()).thenReturn(AtlasErrorCode.NOTIFICATION_EXCEPTION.getHttpCode().getStatusCode());
- when(response.getEntity(String.class)).thenReturn(AtlasErrorCode.NOTIFICATION_EXCEPTION.getErrorCode());
- when(builder.method(anyString(), ArgumentMatchers.>any(), anyList())).thenReturn(response);
+ when(response.readEntity((Class) anyObject())).thenReturn(AtlasErrorCode.NOTIFICATION_EXCEPTION.getErrorCode());
+ when(builder.method(anyString(), (Entity>) anyObject())).thenReturn(response);
((RestNotification) notifier).atlasClientV2 = client;
@@ -115,19 +115,19 @@ public void testNotificationException() {
}
}
- private WebResource.Builder setupBuilder(AtlasClientV2.API api, WebResource webResource) {
+ private Invocation.Builder setupBuilder(AtlasClientV2.API api, WebTarget webResource) {
when(webResource.path(api.getPath())).thenReturn(service);
when(webResource.path(api.getNormalizedPath())).thenReturn(service);
return getBuilder(service);
}
- private WebResource.Builder getBuilder(WebResource resourceObject) {
- when(resourceObject.getRequestBuilder()).thenReturn(resourceBuilderMock);
+ private Invocation.Builder getBuilder(WebTarget resourceObject) {
+ when(resourceObject.request()).thenReturn(resourceBuilderMock);
when(resourceObject.path(anyString())).thenReturn(resourceObject);
when(resourceBuilderMock.accept(MediaType.APPLICATION_JSON)).thenReturn(resourceBuilderMock);
- when(resourceBuilderMock.type(MediaType.MULTIPART_FORM_DATA)).thenReturn(resourceBuilderMock);
- when(resourceBuilderMock.type(MediaType.APPLICATION_JSON + "; charset=UTF-8")).thenReturn(resourceBuilderMock);
+ when(resourceBuilderMock.accept(MediaType.MULTIPART_FORM_DATA)).thenReturn(resourceBuilderMock);
+ when(resourceBuilderMock.accept(MediaType.APPLICATION_JSON + "; charset=UTF-8")).thenReturn(resourceBuilderMock);
return resourceBuilderMock;
}
diff --git a/pom.xml b/pom.xml
index c0f35938789..8cd1f1ae403 100644
--- a/pom.xml
+++ b/pom.xml
@@ -126,21 +126,24 @@
3.4.2
2.6.4
3.1.3
+ 2.6.1
0.8.1
4.5.13
4.4.13
2.5.2
2.12.7
- 2.12.7
+ 2.15.3
0.8.13
0.5.3
1.1.0
1
2.2.1
3.1.0
+ 2.1.6
2.3.1
1.19.4
1.19
+ 2.36
1.5.4
30
9.4.56.v20240826
@@ -156,6 +159,7 @@
8.11.3
3.11.0
3.0.1
+ 3.5.1
3.7
3.2.1
3.12.4
@@ -278,66 +282,6 @@
${okio.version}
-
-
- com.sun.jersey
- jersey-client
- ${jersey.version}
-
-
-
- com.sun.jersey
- jersey-core
- ${jersey.version}
-
-
-
- com.sun.jersey
- jersey-server
- ${jersey.version}
-
-
-
- com.sun.jersey
- jersey-servlet
- ${jersey.version}
-
-
-
- com.sun.jersey.contribs
- jersey-multipart
- ${jersey.version}
-
-
-
-
- com.sun.jersey.contribs
- jersey-spring
- ${jersey-spring.version}
-
-
- org.springframework
- spring
-
-
- org.springframework
- spring-beans
-
-
- org.springframework
- spring-context
-
-
- org.springframework
- spring-core
-
-
- org.springframework
- spring-web
-
-
-
-
com.webcohesion.enunciate
@@ -660,6 +604,10 @@
com.google.guava
guava
+
+ com.sun.jersey
+ *
+
commons-httpclient
*
@@ -703,34 +651,6 @@
-
- org.apache.hadoop
- hadoop-hdfs
- ${hadoop.version}
-
-
- com.google.guava
- guava
-
-
- javax.servlet
- *
-
-
- org.codehaus.jackson
- *
-
-
- org.mortbay.jetty
- *
-
-
- tomcat
- *
-
-
-
-
org.apache.hbase
hbase-client
@@ -892,6 +812,49 @@
3.0.0
+
+ org.glassfish.jersey.containers
+ jersey-container-servlet
+ ${jersey2.version}
+
+
+
+
+ org.glassfish.jersey.core
+ jersey-client
+ ${jersey2.version}
+
+
+
+ org.glassfish.jersey.core
+ jersey-common
+ ${jersey2.version}
+
+
+
+ org.glassfish.jersey.core
+ jersey-server
+ ${jersey2.version}
+
+
+
+ org.glassfish.jersey.ext
+ jersey-spring5
+ ${jersey2.version}
+
+
+
+ org.glassfish.jersey.inject
+ jersey-hk2
+ ${jersey2.version}
+
+
+
+ org.glassfish.jersey.media
+ jersey-media-multipart
+ ${jersey2.version}
+
+
org.jacoco
jacoco-maven-plugin
@@ -969,6 +932,35 @@
test
+
+ org.apache.hadoop
+ hadoop-hdfs
+ ${hadoop.version}
+ test
+
+
+ com.google.guava
+ guava
+
+
+ javax.servlet
+ *
+
+
+ org.codehaus.jackson
+ *
+
+
+ org.mortbay.jetty
+ *
+
+
+ tomcat
+ *
+
+
+
+
org.apache.hadoop
hadoop-minikdc
@@ -1023,6 +1015,12 @@
3.3.0
+
+ jakarta.ws.rs
+ jakarta.ws.rs-api
+ ${javax.ws.rs-api}
+
+
org.slf4j
jul-to-slf4j
diff --git a/repository/pom.xml b/repository/pom.xml
index 701baf9f4a7..5e90a7eff6d 100644
--- a/repository/pom.xml
+++ b/repository/pom.xml
@@ -215,6 +215,17 @@
${javax.persistence.version}
+
+ org.glassfish.jersey.core
+ jersey-client
+ ${jersey2.version}
+
+
+ org.glassfish.jersey.core
+ jersey-server
+ ${jersey2.version}
+
+
org.mockito
mockito-core
diff --git a/tools/atlas-migration-exporter/atlas-logback.xml b/tools/atlas-migration-exporter/atlas-logback.xml
index 2c76b46f8e1..5f20673129c 100755
--- a/tools/atlas-migration-exporter/atlas-logback.xml
+++ b/tools/atlas-migration-exporter/atlas-logback.xml
@@ -57,7 +57,7 @@
-
+
diff --git a/tools/classification-updater/src/main/java/org/apache/atlas/tools/BulkFetchAndUpdate.java b/tools/classification-updater/src/main/java/org/apache/atlas/tools/BulkFetchAndUpdate.java
index a4eb06fd90c..73d4dd74494 100644
--- a/tools/classification-updater/src/main/java/org/apache/atlas/tools/BulkFetchAndUpdate.java
+++ b/tools/classification-updater/src/main/java/org/apache/atlas/tools/BulkFetchAndUpdate.java
@@ -18,7 +18,6 @@
package org.apache.atlas.tools;
-import com.sun.jersey.core.util.MultivaluedMapImpl;
import org.apache.atlas.ApplicationProperties;
import org.apache.atlas.AtlasClientV2;
import org.apache.atlas.AtlasException;
@@ -44,6 +43,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import javax.ws.rs.core.MultivaluedHashMap;
import javax.ws.rs.core.MultivaluedMap;
import java.io.BufferedReader;
@@ -453,7 +453,7 @@ private String getUniqueAttribute(String typeName) {
}
private List getAllClassificationsDefs() throws Exception {
- MultivaluedMap searchParams = new MultivaluedMapImpl();
+ MultivaluedMap searchParams = new MultivaluedHashMap();
searchParams.add(SearchFilter.PARAM_TYPE, "CLASSIFICATION");
SearchFilter searchFilter = new SearchFilter(searchParams);
diff --git a/webapp/pom.xml b/webapp/pom.xml
index f28f92c4561..36ba71b99c5 100755
--- a/webapp/pom.xml
+++ b/webapp/pom.xml
@@ -58,6 +58,12 @@
${jackson.version}
+
+ com.fasterxml.jackson.module
+ jackson-module-jaxb-annotations
+ ${jackson.version}
+
+
com.googlecode.json-simple
json-simple
@@ -75,36 +81,6 @@
-
- com.sun.jersey
- jersey-client
-
-
-
- com.sun.jersey
- jersey-core
-
-
-
- com.sun.jersey
- jersey-server
-
-
- com.sun.jersey
- jersey-servlet
-
-
-
- com.sun.jersey.contribs
- jersey-multipart
-
-
-
-
- com.sun.jersey.contribs
- jersey-spring
-
-
com.webcohesion.enunciate
enunciate-core-annotations
@@ -243,6 +219,10 @@
org.apache.hadoop
hadoop-common
+
+ com.sun.jersey
+ *
+
javax.servlet
servlet-api
@@ -265,29 +245,6 @@
-
-
- org.apache.hadoop
- hadoop-hdfs
-
-
- io.netty
- netty-handler
-
-
- io.netty
- netty-transport-native-epoll
-
-
- javax.servlet
- servlet-api
-
-
- org.eclipse.jetty
- *
-
-
-
org.apache.hadoop
hadoop-hdfs-client
@@ -357,6 +314,48 @@
org.glassfish
javax.el
+
+ org.glassfish.jersey.containers
+ jersey-container-servlet
+ ${jersey2.version}
+
+
+
+ org.glassfish.jersey.core
+ jersey-client
+ ${jersey2.version}
+
+
+
+ org.glassfish.jersey.core
+ jersey-common
+ ${jersey2.version}
+
+
+
+ org.glassfish.jersey.core
+ jersey-server
+ ${jersey2.version}
+
+
+
+ org.glassfish.jersey.ext
+ jersey-entity-filtering
+ ${jersey2.version}
+
+
+
+
+ org.glassfish.jersey.ext
+ jersey-spring5
+ ${jersey2.version}
+
+
+
+ org.glassfish.jersey.media
+ jersey-media-multipart
+ ${jersey2.version}
+
@@ -484,6 +483,42 @@
test
+
+ org.apache.hadoop
+ hadoop-hdfs
+ test
+
+
+ com.sun.jersey
+ jersey-core
+
+
+ com.sun.jersey
+ jersey-core
+
+
+ com.sun.jersey
+ jersey-server
+
+
+ io.netty
+ netty-handler
+
+
+ io.netty
+ netty-transport-native-epoll
+
+
+ javax.servlet
+ servlet-api
+
+
+ org.eclipse.jetty
+ *
+
+
+
+
org.easymock
easymock
@@ -533,7 +568,8 @@
true
- WEB-INF/lib/hbase-shaded-client-${hbase.version}-hadoop3.jar,WEB-INF/lib/dom4j-*.jar,WEB-INF/lib/jsp-api*.jar,${packages.to.exclude}
+ WEB-INF/lib/hbase-shaded-client-${hbase.version}-hadoop3.jar,WEB-INF/lib/dom4j-*.jar,WEB-INF/lib/jsp-api*.jar,${packages.to.exclude}
+ WEB-INF/lib/junit*.jar,WEB-INF/lib/dom4j-*.jar,WEB-INF/lib/jersey-server-1.*.jar,${packages.to.exclude}
diff --git a/webapp/src/main/java/org/apache/atlas/examples/QuickStartV2.java b/webapp/src/main/java/org/apache/atlas/examples/QuickStartV2.java
index a43cfc6390d..ab4b480797f 100755
--- a/webapp/src/main/java/org/apache/atlas/examples/QuickStartV2.java
+++ b/webapp/src/main/java/org/apache/atlas/examples/QuickStartV2.java
@@ -19,7 +19,6 @@
package org.apache.atlas.examples;
import com.google.common.annotations.VisibleForTesting;
-import com.sun.jersey.core.util.MultivaluedMapImpl;
import org.apache.atlas.ApplicationProperties;
import org.apache.atlas.AtlasClientV2;
import org.apache.atlas.AtlasException;
@@ -51,6 +50,7 @@
import org.apache.commons.configuration2.Configuration;
import org.apache.commons.lang3.ArrayUtils;
+import javax.ws.rs.core.MultivaluedHashMap;
import javax.ws.rs.core.MultivaluedMap;
import java.util.ArrayList;
@@ -622,7 +622,7 @@ private List toAtlasClassifications(String[] classification
}
private void verifyTypesCreated() throws Exception {
- MultivaluedMap searchParams = new MultivaluedMapImpl();
+ MultivaluedMap searchParams = new MultivaluedHashMap<>();
for (String typeName : TYPES) {
searchParams.clear();
diff --git a/webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java b/webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java
index da9967a1ce3..a3c63ae0dc5 100755
--- a/webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java
+++ b/webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java
@@ -18,7 +18,6 @@
package org.apache.atlas.web.resources;
-import com.sun.jersey.multipart.FormDataParam;
import org.apache.atlas.ApplicationProperties;
import org.apache.atlas.AtlasClient;
import org.apache.atlas.AtlasConfiguration;
@@ -88,6 +87,7 @@
import org.apache.commons.configuration2.io.FileHandler;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.StringUtils;
+import org.glassfish.jersey.media.multipart.FormDataParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
diff --git a/webapp/src/main/java/org/apache/atlas/web/resources/TypesResource.java b/webapp/src/main/java/org/apache/atlas/web/resources/TypesResource.java
index 8451997fc88..b2fb67f503c 100755
--- a/webapp/src/main/java/org/apache/atlas/web/resources/TypesResource.java
+++ b/webapp/src/main/java/org/apache/atlas/web/resources/TypesResource.java
@@ -18,8 +18,6 @@
package org.apache.atlas.web.resources;
-import com.sun.jersey.api.client.ClientResponse;
-import com.sun.jersey.api.core.ResourceContext;
import org.apache.atlas.AtlasClient;
import org.apache.atlas.exception.AtlasBaseException;
import org.apache.atlas.model.typedef.AtlasTypesDef;
@@ -78,9 +76,6 @@ public class TypesResource {
private final TypesREST typesREST;
private final AtlasTypeDefStore typeDefStore;
- @Context
- private ResourceContext resourceContext;
-
@Inject
public TypesResource(AtlasTypeRegistry typeRegistry, TypesREST typesREST, AtlasTypeDefStore typeDefStore) {
TypesResource.typeRegistry = typeRegistry;
@@ -124,7 +119,7 @@ public Response submit(@Context HttpServletRequest request) {
response.put(AtlasClient.REQUEST_ID, Servlets.getRequestId());
response.put(AtlasClient.TYPES, typesResponse);
- return Response.status(ClientResponse.Status.CREATED).entity(AtlasJson.toV1Json(response)).build();
+ return Response.status(Response.Status.CREATED).entity(AtlasJson.toV1Json(response)).build();
} catch (AtlasBaseException e) {
LOG.error("Type creation failed", e);
diff --git a/webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java b/webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java
index 07f142d82a6..0126df5c8d8 100644
--- a/webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java
+++ b/webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java
@@ -17,8 +17,6 @@
*/
package org.apache.atlas.web.rest;
-import com.sun.jersey.core.header.FormDataContentDisposition;
-import com.sun.jersey.multipart.FormDataParam;
import org.apache.atlas.AtlasErrorCode;
import org.apache.atlas.EntityAuditEvent;
import org.apache.atlas.RequestContext;
@@ -54,6 +52,8 @@
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils;
+import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
+import org.glassfish.jersey.media.multipart.FormDataParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
diff --git a/webapp/src/main/java/org/apache/atlas/web/rest/GlossaryREST.java b/webapp/src/main/java/org/apache/atlas/web/rest/GlossaryREST.java
index a9b7196674e..007556c6b65 100644
--- a/webapp/src/main/java/org/apache/atlas/web/rest/GlossaryREST.java
+++ b/webapp/src/main/java/org/apache/atlas/web/rest/GlossaryREST.java
@@ -17,8 +17,6 @@
*/
package org.apache.atlas.web.rest;
-import com.sun.jersey.core.header.FormDataContentDisposition;
-import com.sun.jersey.multipart.FormDataParam;
import org.apache.atlas.AtlasErrorCode;
import org.apache.atlas.SortOrder;
import org.apache.atlas.annotation.Timed;
@@ -35,6 +33,8 @@
import org.apache.atlas.utils.AtlasPerfTracer;
import org.apache.atlas.web.util.Servlets;
import org.apache.commons.collections.MapUtils;
+import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
+import org.glassfish.jersey.media.multipart.FormDataParam;
import org.slf4j.Logger;
import org.springframework.stereotype.Service;
diff --git a/webapp/src/main/webapp/WEB-INF/web.xml b/webapp/src/main/webapp/WEB-INF/web.xml
index 7bc93192058..e2a6b47802b 100755
--- a/webapp/src/main/webapp/WEB-INF/web.xml
+++ b/webapp/src/main/webapp/WEB-INF/web.xml
@@ -28,11 +28,15 @@
jersey-servlet
- com.sun.jersey.spi.spring.container.servlet.SpringServlet
+ org.glassfish.jersey.servlet.ServletContainer
- com.sun.jersey.api.json.POJOMappingFeature
- true
+ jersey.config.server.provider.packages
+ org.apache.atlas.web.rest,org.apache.atlas.web.resources,org.apache.atlas.web.errors
+
+
+ jersey.config.server.provider.classnames
+ org.glassfish.jersey.media.multipart.MultiPartFeature,com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider
1
diff --git a/webapp/src/test/java/org/apache/atlas/web/integration/EntityJerseyResourceIT.java b/webapp/src/test/java/org/apache/atlas/web/integration/EntityJerseyResourceIT.java
index 383ef3390a9..6546453b09c 100755
--- a/webapp/src/test/java/org/apache/atlas/web/integration/EntityJerseyResourceIT.java
+++ b/webapp/src/test/java/org/apache/atlas/web/integration/EntityJerseyResourceIT.java
@@ -20,8 +20,6 @@
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
-import com.sun.jersey.api.client.ClientResponse;
-import com.sun.jersey.core.util.MultivaluedMapImpl;
import org.apache.atlas.AtlasClient;
import org.apache.atlas.AtlasServiceException;
import org.apache.atlas.EntityAuditEvent;
@@ -45,6 +43,7 @@
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
+import javax.ws.rs.core.MultivaluedHashMap;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;
@@ -57,7 +56,7 @@
import java.util.Map;
import java.util.UUID;
-import static com.sun.jersey.api.client.ClientResponse.Status.BAD_REQUEST;
+import static javax.ws.rs.core.Response.Status.BAD_REQUEST;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertNull;
@@ -487,7 +486,7 @@ public void testGetEntityList() throws Exception {
@Test(expectedExceptions = AtlasServiceException.class)
public void testGetEntityListForBadEntityType() throws Exception {
- MultivaluedMap queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
queryParams.add("type", "blah");
ObjectNode response = atlasClientV1.callAPIWithQueryParams(AtlasClient.API_V1.GET_ENTITY, queryParams);
@@ -499,7 +498,7 @@ public void testGetEntityListForBadEntityType() throws Exception {
public void testGetEntityListForNoInstances() throws Exception {
String typeName = addNewType();
- MultivaluedMap queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
queryParams.add("type", typeName);
ObjectNode response = atlasClientV1.callAPIWithQueryParams(AtlasClient.API_V1.GET_ENTITY, queryParams);
@@ -726,7 +725,7 @@ public void testDeleteTrait() throws Exception {
atlasClientV1.getTraitDefinition(guid, traitName);
fail("Deleted trait definition shouldn't exist");
} catch (AtlasServiceException e) {
- assertEquals(e.getStatus(), ClientResponse.Status.NOT_FOUND);
+ assertEquals(e.getStatus(), Response.Status.NOT_FOUND);
assertEntityAudit(guid, EntityAuditEvent.EntityAuditAction.TAG_DELETE);
}
}
@@ -783,7 +782,7 @@ public void testDeleteExistentTraitNonExistentForEntity() throws Exception {
} catch (AtlasServiceException e) {
assertNotNull(e);
assertNotNull(e.getStatus());
- assertEquals(e.getStatus(), ClientResponse.Status.BAD_REQUEST);
+ assertEquals(e.getStatus(), Response.Status.BAD_REQUEST);
}
}
@@ -1004,7 +1003,7 @@ public void testDeleteEntitiesViaRestApi() throws Exception {
Id db2Id = createInstance(db2);
// Delete the database entities
- MultivaluedMap queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
queryParams.add(AtlasClient.GUID.toLowerCase(), db1Id._getId());
queryParams.add(AtlasClient.GUID.toLowerCase(), db2Id._getId());
diff --git a/webapp/src/test/java/org/apache/atlas/web/integration/EntityLineageJerseyResourceIT.java b/webapp/src/test/java/org/apache/atlas/web/integration/EntityLineageJerseyResourceIT.java
index 8db1bf08fc4..e07d948f792 100644
--- a/webapp/src/test/java/org/apache/atlas/web/integration/EntityLineageJerseyResourceIT.java
+++ b/webapp/src/test/java/org/apache/atlas/web/integration/EntityLineageJerseyResourceIT.java
@@ -19,7 +19,6 @@
package org.apache.atlas.web.integration;
import com.fasterxml.jackson.databind.node.ObjectNode;
-import com.sun.jersey.core.util.MultivaluedMapImpl;
import org.apache.atlas.AtlasBaseClient;
import org.apache.atlas.AtlasClient;
import org.apache.atlas.model.instance.AtlasEntityHeader;
@@ -30,6 +29,7 @@
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
+import javax.ws.rs.core.MultivaluedHashMap;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;
@@ -70,7 +70,7 @@ public void setUp() throws Exception {
public void testInputLineageInfo() throws Exception {
String tableId = atlasClientV1.getEntity(HIVE_TABLE_TYPE, AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME, salesMonthlyTable).getId()._getId();
- MultivaluedMap queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
queryParams.add(DIRECTION_PARAM, INPUT_DIRECTION);
queryParams.add(DEPTH_PARAM, "5");
@@ -102,7 +102,7 @@ public void testInputLineageInfo() throws Exception {
public void testOutputLineageInfo() throws Exception {
String tableId = atlasClientV1.getEntity(HIVE_TABLE_TYPE, AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME, salesFactTable).getId()._getId();
- MultivaluedMap queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
queryParams.add(DIRECTION_PARAM, OUTPUT_DIRECTION);
queryParams.add(DEPTH_PARAM, "5");
@@ -134,7 +134,7 @@ public void testOutputLineageInfo() throws Exception {
public void testLineageInfo() throws Exception {
String tableId = atlasClientV1.getEntity(HIVE_TABLE_TYPE, AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME, salesMonthlyTable).getId()._getId();
- MultivaluedMap queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap();
queryParams.add(DIRECTION_PARAM, BOTH_DIRECTION);
queryParams.add(DEPTH_PARAM, "5");
diff --git a/webapp/src/test/java/org/apache/atlas/web/integration/EntityV2JerseyResourceIT.java b/webapp/src/test/java/org/apache/atlas/web/integration/EntityV2JerseyResourceIT.java
index 3d2ba97d51d..4d0df8a5df6 100755
--- a/webapp/src/test/java/org/apache/atlas/web/integration/EntityV2JerseyResourceIT.java
+++ b/webapp/src/test/java/org/apache/atlas/web/integration/EntityV2JerseyResourceIT.java
@@ -22,7 +22,6 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.google.common.collect.Lists;
-import com.sun.jersey.api.client.ClientResponse;
import org.apache.atlas.ApplicationProperties;
import org.apache.atlas.AtlasClient;
import org.apache.atlas.AtlasServiceException;
@@ -55,6 +54,8 @@
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
+import javax.ws.rs.core.Response;
+
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
@@ -394,10 +395,7 @@ public void testGetEntityListForNoInstances() {
@Test(dependsOnMethods = "testSubmitEntity")
public void testGetTraitNames() throws Exception {
- AtlasClassifications classifications = atlasClientV2.getClassifications(createHiveTable().getGuid());
- assertNotNull(classifications);
- assertFalse(classifications.getList().isEmpty());
- assertEquals(classifications.getList().size(), 9);
+ assertBaselineClassifications(createHiveTable().getGuid());
}
@Test(dependsOnMethods = "testSubmitEntity")
@@ -521,6 +519,8 @@ public void testGetTraitDefinitionForEntity() throws Exception {
AtlasEntity hiveTable = createHiveTable();
assertEquals(hiveTable.getClassifications().size(), 7);
+ int baselineCount = atlasClientV2.getClassifications(hiveTable.getGuid()).getList().size();
+
AtlasClassification piiClassification = new AtlasClassification(piiTrait.getName());
atlasClientV2.addClassifications(hiveTable.getGuid(), Lists.newArrayList(piiClassification));
@@ -528,7 +528,7 @@ public void testGetTraitDefinitionForEntity() throws Exception {
AtlasClassifications classifications = atlasClientV2.getClassifications(hiveTable.getGuid());
assertNotNull(classifications);
assertFalse(classifications.getList().isEmpty());
- assertEquals(classifications.getList().size(), 9);
+ assertEquals(classifications.getList().size(), baselineCount + 1);
}
@Test(dependsOnMethods = "testGetTraitNames")
@@ -595,7 +595,7 @@ public void testDeleteTraitNonExistent() {
} catch (AtlasServiceException ex) {
assertNotNull(ex.getStatus());
// assertEquals(ex.getStatus(), ClientResponse.Status.NOT_FOUND);
- assertEquals(ex.getStatus(), ClientResponse.Status.BAD_REQUEST);
+ assertEquals(ex.getStatus(), Response.Status.BAD_REQUEST);
// Should it be a 400 or 404
}
}
@@ -616,7 +616,7 @@ public void testDeleteExistentTraitNonExistentForEntity() throws Exception {
fail("Deletion should've failed for non-existent trait association");
} catch (AtlasServiceException ex) {
assertNotNull(ex.getStatus());
- assertEquals(ex.getStatus(), ClientResponse.Status.BAD_REQUEST);
+ assertEquals(ex.getStatus(), Response.Status.BAD_REQUEST);
}
}
@@ -1201,6 +1201,21 @@ private Map toMap(final String name, final String value) {
return new HashMap<>(Collections.singletonMap(name, value));
}
+ private void assertBaselineClassifications(String entityGuid) throws AtlasServiceException {
+ AtlasClassifications classifications = atlasClientV2.getClassifications(entityGuid);
+ assertNotNull(classifications);
+ assertFalse(classifications.getList().isEmpty());
+
+ Set expectedTraits = new HashSet<>(Arrays.asList(
+ CLASSIFICATION, PII_TAG, PHI_TAG, PCI_TAG, SOX_TAG, SEC_TAG, FINANCE_TAG));
+
+ for (AtlasClassification classification : classifications.getList()) {
+ expectedTraits.remove(classification.getTypeName());
+ }
+
+ assertTrue(expectedTraits.isEmpty(), "Missing baseline classifications: " + expectedTraits);
+ }
+
private AtlasEntityHeader createRandomDatabaseEntity() {
AtlasEntity db = new AtlasEntity(DATABASE_TYPE_V2);
String dbName = randomString();
diff --git a/webapp/src/test/java/org/apache/atlas/web/integration/GlossaryClientV2IT.java b/webapp/src/test/java/org/apache/atlas/web/integration/GlossaryClientV2IT.java
index b7fe6c0d4ae..48007846da0 100644
--- a/webapp/src/test/java/org/apache/atlas/web/integration/GlossaryClientV2IT.java
+++ b/webapp/src/test/java/org/apache/atlas/web/integration/GlossaryClientV2IT.java
@@ -20,7 +20,6 @@
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
-import com.sun.jersey.api.client.ClientResponse;
import org.apache.atlas.AtlasClientV2;
import org.apache.atlas.AtlasServiceException;
import org.apache.atlas.bulkimport.BulkImportResponse;
@@ -45,6 +44,8 @@
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
+import javax.ws.rs.core.Response;
+
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
@@ -393,13 +394,13 @@ public void testDeleteGlossary() throws Exception {
atlasClientV2.getGlossaryByGuid(healthCareGlossary.getGuid());
} catch (AtlasServiceException ex) {
assertNotNull(ex.getStatus());
- assertEquals(ex.getStatus(), ClientResponse.Status.NOT_FOUND);
+ assertEquals(ex.getStatus(), Response.Status.NOT_FOUND);
}
try {
atlasClientV2.getGlossaryByGuid(educationGlossary.getGuid());
} catch (AtlasServiceException ex) {
assertNotNull(ex.getStatus());
- assertEquals(ex.getStatus(), ClientResponse.Status.NOT_FOUND);
+ assertEquals(ex.getStatus(), Response.Status.NOT_FOUND);
}
}
@@ -410,7 +411,7 @@ public void testDeleteGlossaryTerm() throws Exception {
atlasClientV2.getGlossaryTerm(educationTerm.getGuid());
} catch (AtlasServiceException ex) {
assertNotNull(ex.getStatus());
- assertEquals(ex.getStatus(), ClientResponse.Status.NOT_FOUND);
+ assertEquals(ex.getStatus(), Response.Status.NOT_FOUND);
}
}
@@ -421,7 +422,7 @@ public void testDeleteGlossaryCategory() throws Exception {
atlasClientV2.getGlossaryCategory(educationCategory.getGuid());
} catch (AtlasServiceException ex) {
assertNotNull(ex.getStatus());
- assertEquals(ex.getStatus(), ClientResponse.Status.NOT_FOUND);
+ assertEquals(ex.getStatus(), Response.Status.NOT_FOUND);
}
}
diff --git a/webapp/src/test/java/org/apache/atlas/web/integration/TypedefsJerseyResourceIT.java b/webapp/src/test/java/org/apache/atlas/web/integration/TypedefsJerseyResourceIT.java
index daefbbce1bd..7de5edb0cba 100644
--- a/webapp/src/test/java/org/apache/atlas/web/integration/TypedefsJerseyResourceIT.java
+++ b/webapp/src/test/java/org/apache/atlas/web/integration/TypedefsJerseyResourceIT.java
@@ -18,7 +18,6 @@
package org.apache.atlas.web.integration;
-import com.sun.jersey.core.util.MultivaluedMapImpl;
import org.apache.atlas.AtlasClientV2;
import org.apache.atlas.AtlasServiceException;
import org.apache.atlas.exception.AtlasBaseException;
@@ -42,6 +41,7 @@
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
+import javax.ws.rs.core.MultivaluedHashMap;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;
@@ -117,7 +117,7 @@ public void testCreate() throws Exception {
@Test
public void testGetHeaders() throws Exception {
- MultivaluedMap filterParams = new MultivaluedMapImpl();
+ MultivaluedMap filterParams = new MultivaluedHashMap();
filterParams.add(SearchFilter.PARAM_TYPE, "ENTITY");
@@ -187,7 +187,7 @@ public void testUpdate() throws Exception {
assertEquals(updatedTypeDefs.getEntityDefs().size(), atlasTypesDef.getEntityDefs().size());
assertEquals(updatedTypeDefs.getEntityDefs().get(0).getName(), atlasTypesDef.getEntityDefs().get(0).getName());
- MultivaluedMap filterParams = new MultivaluedMapImpl();
+ MultivaluedMap filterParams = new MultivaluedHashMap();
filterParams.add(SearchFilter.PARAM_TYPE, "ENTITY");
@@ -356,7 +356,7 @@ public void testListTypesByFilter() throws Exception {
assertNotNull(created);
assertEquals(created.getEntityDefs().size(), atlasTypesDef.getEntityDefs().size());
- MultivaluedMap searchParams = new MultivaluedMapImpl();
+ MultivaluedMap searchParams = new MultivaluedHashMap();
searchParams.add(SearchFilter.PARAM_TYPE, "CLASS");
searchParams.add(SearchFilter.PARAM_SUPERTYPE, classDefA.getName());
diff --git a/webapp/src/test/java/org/apache/atlas/web/integration/TypesJerseyResourceIT.java b/webapp/src/test/java/org/apache/atlas/web/integration/TypesJerseyResourceIT.java
index 4e2f3febf0f..7a7faeb8364 100755
--- a/webapp/src/test/java/org/apache/atlas/web/integration/TypesJerseyResourceIT.java
+++ b/webapp/src/test/java/org/apache/atlas/web/integration/TypesJerseyResourceIT.java
@@ -20,7 +20,6 @@
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
-import com.sun.jersey.core.util.MultivaluedMapImpl;
import org.apache.atlas.AtlasClient;
import org.apache.atlas.AtlasServiceException;
import org.apache.atlas.model.typedef.AtlasBaseTypeDef;
@@ -37,6 +36,7 @@
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
+import javax.ws.rs.core.MultivaluedHashMap;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;
@@ -206,7 +206,7 @@ public void testGetTypeNames() throws Exception {
public void testGetTraitNames() throws Exception {
String[] traitsAdded = addTraits();
- MultivaluedMap queryParams = new MultivaluedMapImpl();
+ MultivaluedMap queryParams = new MultivaluedHashMap<>();
queryParams.add("type", DataTypes.TypeCategory.TRAIT.name());
ObjectNode response = atlasClientV1.callAPIWithQueryParams(AtlasClient.API_V1.LIST_TYPES, queryParams);
diff --git a/webapp/src/test/java/org/apache/atlas/web/rest/EntityRESTTest.java b/webapp/src/test/java/org/apache/atlas/web/rest/EntityRESTTest.java
index 1f2c5ca40e3..def7a1803dd 100644
--- a/webapp/src/test/java/org/apache/atlas/web/rest/EntityRESTTest.java
+++ b/webapp/src/test/java/org/apache/atlas/web/rest/EntityRESTTest.java
@@ -12,7 +12,6 @@
*/
package org.apache.atlas.web.rest;
-import com.sun.jersey.core.header.FormDataContentDisposition;
import org.apache.atlas.AtlasConfiguration;
import org.apache.atlas.AtlasErrorCode;
import org.apache.atlas.EntityAuditEvent;
@@ -40,6 +39,7 @@
import org.apache.atlas.type.AtlasTypeRegistry;
import org.apache.atlas.util.FileUtils;
import org.apache.atlas.web.util.Servlets;
+import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
import org.mockito.ArgumentCaptor;
import org.mockito.InjectMocks;
import org.mockito.Mock;
diff --git a/webapp/src/test/java/org/apache/atlas/web/rest/GlossaryRESTTest.java b/webapp/src/test/java/org/apache/atlas/web/rest/GlossaryRESTTest.java
index 00233cf5d78..288413362bb 100644
--- a/webapp/src/test/java/org/apache/atlas/web/rest/GlossaryRESTTest.java
+++ b/webapp/src/test/java/org/apache/atlas/web/rest/GlossaryRESTTest.java
@@ -12,7 +12,6 @@
*/
package org.apache.atlas.web.rest;
-import com.sun.jersey.core.header.FormDataContentDisposition;
import org.apache.atlas.AtlasConfiguration;
import org.apache.atlas.AtlasErrorCode;
import org.apache.atlas.SortOrder;
@@ -28,6 +27,7 @@
import org.apache.atlas.model.glossary.relations.AtlasRelatedCategoryHeader;
import org.apache.atlas.model.glossary.relations.AtlasRelatedTermHeader;
import org.apache.atlas.model.instance.AtlasRelatedObjectId;
+import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.testng.annotations.BeforeMethod;
diff --git a/webapp/src/test/java/org/apache/atlas/web/service/SecureEmbeddedServerTestBase.java b/webapp/src/test/java/org/apache/atlas/web/service/SecureEmbeddedServerTestBase.java
index bb77e5fabc0..c5a4f8a83d1 100755
--- a/webapp/src/test/java/org/apache/atlas/web/service/SecureEmbeddedServerTestBase.java
+++ b/webapp/src/test/java/org/apache/atlas/web/service/SecureEmbeddedServerTestBase.java
@@ -16,9 +16,6 @@
*/
package org.apache.atlas.web.service;
-import com.sun.jersey.api.client.Client;
-import com.sun.jersey.api.client.WebResource;
-import com.sun.jersey.api.client.config.DefaultClientConfig;
import org.apache.atlas.ApplicationProperties;
import org.apache.atlas.Atlas;
import org.apache.atlas.AtlasException;
@@ -32,12 +29,16 @@
import org.apache.hadoop.security.alias.CredentialProvider;
import org.apache.hadoop.security.alias.CredentialProviderFactory;
import org.apache.hadoop.security.alias.JavaKeyStoreProvider;
+import org.glassfish.jersey.client.ClientConfig;
import org.testng.TestListenerAdapter;
import org.testng.TestNG;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.ClientBuilder;
+import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.UriBuilder;
import java.io.File;
@@ -57,7 +58,7 @@ public class SecureEmbeddedServerTestBase {
public static final int ATLAS_DEFAULT_HTTPS_PORT = 21443;
protected String providerUrl;
- protected WebResource service;
+ protected WebTarget service;
private SecureEmbeddedServer secureEmbeddedServer;
private Path jksPath;
private int securePort;
@@ -76,12 +77,12 @@ public void setup() throws Exception {
String baseUrl = String.format("https://localhost:%d/", securePort);
- DefaultClientConfig config = new DefaultClientConfig();
- Client client = Client.create(config);
+ ClientConfig config = new ClientConfig();
+ Client client = ClientBuilder.newClient(config);
- client.resource(UriBuilder.fromUri(baseUrl).build());
+ client.target(UriBuilder.fromUri(baseUrl).build());
- service = client.resource(UriBuilder.fromUri(baseUrl).build());
+ service = client.target(UriBuilder.fromUri(baseUrl).build());
}
@Test
diff --git a/webapp/src/test/webapp/WEB-INF/web.xml b/webapp/src/test/webapp/WEB-INF/web.xml
index fd1d492fcdf..d9dd5767067 100755
--- a/webapp/src/test/webapp/WEB-INF/web.xml
+++ b/webapp/src/test/webapp/WEB-INF/web.xml
@@ -33,11 +33,15 @@
jersey-servlet
- com.sun.jersey.spi.spring.container.servlet.SpringServlet
+ org.glassfish.jersey.servlet.ServletContainer
- com.sun.jersey.api.json.POJOMappingFeature
- true
+ jersey.config.server.provider.packages
+ org.apache.atlas.web.rest,org.apache.atlas.web.resources,org.apache.atlas.web.errors
+
+
+ jersey.config.server.provider.classnames
+ org.glassfish.jersey.media.multipart.MultiPartFeature,com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider
1