Skip to content

ATLAS-5190: Upgrading jersey version to fix the conflicts caused by jackson upgrade#640

Open
aditya-gupta36 wants to merge 5 commits into
apache:masterfrom
aditya-gupta36:ATLAS-5190
Open

ATLAS-5190: Upgrading jersey version to fix the conflicts caused by jackson upgrade#640
aditya-gupta36 wants to merge 5 commits into
apache:masterfrom
aditya-gupta36:ATLAS-5190

Conversation

@aditya-gupta36

@aditya-gupta36 aditya-gupta36 commented May 21, 2026

Copy link
Copy Markdown
Contributor

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

image

@aditya-gupta36 aditya-gupta36 force-pushed the ATLAS-5190 branch 6 times, most recently from 242218c to 1018526 Compare June 5, 2026 09:30
ramackri pushed a commit to ramackri/atlas that referenced this pull request Jul 6, 2026
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>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the need here maven-failsafe-plugin ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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. -->

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the need here maven-failsafe-plugin ?

<artifactItem>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we keep the version in pom.xml files

<artifactItem>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
<version>1.10</version>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why these plugin is needed?

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration combine.self="merge">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants