Skip to content

AMBARI-26682: Fix View creation with Jetty 12 and Java 17 - #4265

Open
JiaLiangC wants to merge 2 commits into
apache:trunkfrom
JiaLiangC:AMBARI-26682
Open

JiaLiangC wants to merge 2 commits into
apache:trunkfrom
JiaLiangC:AMBARI-26682

Conversation

@JiaLiangC

@JiaLiangC JiaLiangC commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Issue: AMBARI-26682

What changes were proposed in this pull request?

Creating a View on a running Jetty 12 Server fails because Servlet cookie configuration rejects updates in the already started request context. After that is corrected, CGLIB's transitive ASM 7.1 prevents Jetty from scanning the View's Java 17 classes.

Configure new session handlers through Jetty's equivalent setters, preserving the cookie name, path, HttpOnly, HTTPS Secure flag, and inactivity timeout. Import the ASM 9.10.1 BOM to align the runtime family with Jetty. Add regressions for initialization during an actual HTTP request and discovery of a compiled Java 17 annotated servlet. Update the existing Server test to assert real cookie attributes instead of specific setter calls.

How was this patch tested?

All 30 tests passed: AmbariServerTest (14), SessionHandlerConfigurerTest (4), JettyViewJspIntegrationTest (2), AmbariHandlerListTest (5), and AmbariSessionManagerTest (5).

Before the production fixes, the new live-request cases returned HTTP 500 for both HTTP and HTTPS cookie settings, and the annotated-servlet test failed with Unsupported class file major version 61. The existing JSP rendering and custom error page test also passes after the fix.

mvn -B -ntp -o -pl ambari-server -am dependency:tree '-Dincludes=org.ow2.asm:*' -Dverbose confirms that asm, asm-commons, and asm-tree resolve to 9.10.1, including the older CGLIB and Hadoop transitive paths. Python and frontend builds were skipped for this Java-only change.

mvn -B -ntp -o -pl ambari-server -am test -Dtest=AmbariServerTest,SessionHandlerConfigurerTest,JettyViewJspIntegrationTest,AmbariHandlerListTest,AmbariSessionManagerTest -Dsurefire.failIfNoSpecifiedTests=false -DskipPythonTests -DskipUiBuild -Dcheckstyle.skip -Drat.skip

Please review Ambari Contributing Guide before opening a pull request.

@prabhjyotsingh prabhjyotsingh left a comment

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.

LGTM

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.

3 participants