ATLAS-5190: Upgrading jersey version to fix the conflicts caused by jackson upgrade#640
ATLAS-5190: Upgrading jersey version to fix the conflicts caused by jackson upgrade#640aditya-gupta36 wants to merge 5 commits into
Conversation
242218c to
1018526
Compare
…se, sqoop, storm bridges module
1018526 to
9036a26
Compare
9036a26 to
ea3b7bc
Compare
b147e9d to
8914dd7
Compare
Point readers to ATLAS-5190 / PR apache#640 for full Jackson unification via Jersey 2.x. Co-authored-by: Cursor <cursoragent@cursor.com>
| <!-- Parent disables Failsafe forking (forkCount=0). Fork IT JVM for stable Atlas client + Hadoop minicluster. --> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-failsafe-plugin</artifactId> |
There was a problem hiding this comment.
What was the need here maven-failsafe-plugin ?
There was a problem hiding this comment.
Why maven-failsafe-plugin?
The parent POM sets forkCount=0, so all ITs run inside the Maven JVM with one mixed classpath. After the Jersey 2 upgrade, bridge ITs hit classpath conflicts: shaded atlas-client-v2-shaded (relocated JAX-RS → NoSuchMethodError), duplicate Jackson providers, and Hive changing the thread context class loader during SessionState.start().
We override Failsafe per module with forkCount=1, reuseForks=false, and targeted classpathDependencyExcludes. Without these overrides, CI shows failures like LinkageError on ClientBuilder, shaded...RuntimeType NoSuchMethodError, and (on JDK 17) AppClassLoader cannot be cast to URLClassLoader in Hive ITs.
Classloader issue — why it exists?
"Class loader casting to URLClassLoader succeeds in Java 8 but fails in Java 9+ due to the internal modularity changes; the modern application class loader (jdk.internal.loader.ClassLoaders$AppClassLoader) no longer extends URLClassLoader."
Why HiveITSystemClassLoader.java was added?
A custom system class loader installed at JVM startup so Hive’s SessionState.class.getClassLoader() returns a real URLClassLoader:
ITs also call SessionState.start() via the same Hive 3.1.3 code path. On JDK 17, Hive unconditionally casts SessionState.class.getClassLoader() to URLClassLoader. The default JDK 9+ app loader is not a URLClassLoader, so @BeforeClass setUp() fails before any test runs.
HiveITSystemClassLoader is a test-only system class loader (via -Djava.system.class.loader) that makes that cast succeed. It is activated only on JDK 9+ through the hive-it-jdk17 profile and requires forkCount=1.
| <build> | ||
| <plugins> | ||
| <!-- Parent disables Failsafe forking (forkCount=0). Exclude shaded v2 client from IT classpath | ||
| to avoid Jersey NoSuchMethodError on org.apache.atlas.shaded.javax.ws.rs.RuntimeType. --> |
There was a problem hiding this comment.
What was the need here maven-failsafe-plugin ?
| <artifactItem> | ||
| <groupId>javax.annotation</groupId> | ||
| <artifactId>javax.annotation-api</artifactId> | ||
| <version>1.3.2</version> |
There was a problem hiding this comment.
can we keep the version in pom.xml files
| <artifactItem> | ||
| <groupId>commons-configuration</groupId> | ||
| <artifactId>commons-configuration</artifactId> | ||
| <version>1.10</version> |
There was a problem hiding this comment.
common-configuration 1.10 is need? we have already upgraded to 2
| <!-- Parent disables Failsafe forking (forkCount=0). Fork IT JVM; on Java 9+ use | ||
| HiveITSystemClassLoader so Hive 3.1.x SessionState sees a URLClassLoader. --> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> |
There was a problem hiding this comment.
Why these plugin is needed?
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-failsafe-plugin</artifactId> | ||
| <configuration combine.self="merge"> |
What changes were proposed in this pull request?
How was this patch tested?
Build - Docker Build, Local Build
UI Test, Curl API testing, login/logout, start/stop/quick_start scripts, hive query through beeline @docker env
build passed: mvn -Pdist,embedded-solr-it -DskipTests=false -Drat.skip=true -DskipDocs clean verify