Skip to content

The Jakarta REST migration upgrades Jersey 2 to 3.0 and replaces the removed LoggingFilter - #1268

Merged
jkschneider merged 3 commits into
jakarta/jaxb-runtime-providerfrom
jakarta/jersey-3
Oct 4, 2026
Merged

jkschneider merged 3 commits into
jakarta/jaxb-runtime-providerfrom
jakarta/jersey-3

Conversation

@jkschneider

Copy link
Copy Markdown
Member

JavaxWsToJakartaWs moved JAX-RS imports to jakarta.ws.rs but kept Jersey 2, whose APIs still take and return javax.ws.rs types (JerseyClientBuilder.createClient() returns a javax.ws.rs.client.Client), so the migrated callers no longer compiled. It now upgrades the org.glassfish.jersey groups (core, inject, media, containers, ext, bundles and the BOM's group) to 3.0.x with UpgradeDependencyVersion, which leaves a Jersey 3.1 alone, since the existing UpdateJerseyDependencies targets Jakarta EE 10 and 3.1. Jersey 3 also removed org.glassfish.jersey.filter.LoggingFilter, so new recipe JerseyLoggingFilterToFeature replaces a new LoggingFilter(logger, entities) passed directly to Configurable.register with a LoggingFeature that keeps the logger, logs at INFO, logs entities when the flag was set and caps them at 8192 bytes. Other uses of LoggingFilter, such as typed variables, fields, return values and anonymous subclasses, are left for manual migration.

Found by a team of coding agents reviewing a Moderne run of org.openrewrite.java.migrate.jakarta.JavaxMigrationToJakarta over the 31 Arquillian repositories (run 20261003120559-YQoma). The issue is jersey-2-retained in the run's io.moderne.RecipeIssues data table (2 rows), and the fix was discussed and reviewed on the run's message board. A row from the table, as a generalized example:

Jersey 2 still returns javax JAX-RS types to migrated Jakarta callers. (arquillian/arquillian-extension-rest, rest-client/impl/impl-jersey/pom.xml, recipe org.openrewrite.java.migrate.jakarta.JavaxMigrationToJakarta)

Before:

Jersey 2.8; javax.ws.rs.client.Client c = org.glassfish.jersey.client.JerseyClientBuilder.createClient();

What the recipe produced:

Jersey 2.8; jakarta.ws.rs.client.Client c = org.glassfish.jersey.client.JerseyClientBuilder.createClient();

Expected:

Jersey 3.0.x; jakarta.ws.rs.client.Client c = org.glassfish.jersey.client.JerseyClientBuilder.createClient();

Stacked on #1267 (5 of 19); merge that one first.

@jkschneider
jkschneider added this pull request to stack #1284 October 4, 2026 09:43
@jkschneider
jkschneider merged commit a459dff into main Oct 4, 2026
1 check passed
@jkschneider
jkschneider deleted the jakarta/jersey-3 branch October 4, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant