Skip to content

Update Jettison, adjust scope, and fix test configuration - Jersey 2.x - #6035

Merged
dmatej merged 2 commits into
eclipse-ee4j:2.xfrom
Nordix:fix/jettison_2x
Jul 25, 2026
Merged

Update Jettison, adjust scope, and fix test configuration - Jersey 2.x#6035
dmatej merged 2 commits into
eclipse-ee4j:2.xfrom
Nordix:fix/jettison_2x

Conversation

@stecurran-est

@stecurran-est stecurran-est commented Nov 14, 2025

Copy link
Copy Markdown

Description

This PR updates Jettison usage and related build configuration to address security issues. Includes fix to resolve Jettison import issue after change of scope. Jersey 2.x branch.

Changes

  • uplift org.codehaus.jettison:jettison from 1.3.7 → 1.5.2 to resolve the following CVEs:
    CVE-2022-40149
    CVE-2022-40150
    CVE-2022-45685
    CVE-2022-45693
    CVE-2023-1436

  • Set Jettison to provided scope to avoid bundling it into artifacts and prevent inclusion of vulnerable versions.

  • Commented out bookmark, bookmark-em, and simple-console from the examples build. These modules import org.codehaus.jettison.json classes directly, which are no longer available at compile time after changing Jettison to provided scope.

  • Add Jettison with test scope in e2e-entity to fix test compilation.

  • Correct pre-existing Surefire config typo:
    <classpathDependencyExcludes> → <classpathDependencyExclude>.

@senivam

senivam commented Nov 17, 2025

Copy link
Copy Markdown
Contributor

this breaks

INFO: Stopped listener bound to [localhost:44729]
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.770 s -- in org.glassfish.jersey.tests.e2e.sse.SseEventSinkToEventSourceTest
[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Errors: 
[ERROR]   JaxbTest.generateTests()[61][1] » InvocationTarget
[ERROR]   JaxbTest.generateTests()[62][1] » InvocationTarget
[ERROR]   JaxbTest.generateTests()[79][1] » InvocationTarget
[ERROR]   JaxbTest.generateTests()[81][1] » InvocationTarget
[ERROR]   JaxbTest.generateTests()[96][1] » InvocationTarget
[INFO] 
[ERROR] Tests run: 645, Failures: 0, Errors: 5, Skipped: 8

test for all JDKs that are used for the Jersey CI validation.

@jansupol

Copy link
Copy Markdown
Contributor

this breaks

Those are Jettison e2e-entity tests. They say for instance:

java.lang.NoSuchMethodException: Cannot instantiate org.glassfish.jersey.tests.e2e.entity.EmptyRequestWithJaxbTest$MappedJettisonCRTest$MappedJettisonCR class. Instantiation of non-static member classes is not supported.

@stecurran-est

Copy link
Copy Markdown
Author

JSON test data has been updated for e2e-entity tests to reflect change in serialisation behaviour when using Jettison 1.5.2.
The following tests now pass:
JaxbTest.generateTests()[61][1] » InvocationTarget
JaxbTest.generateTests()[62][1] » InvocationTarget
JaxbTest.generateTests()[79][1] » InvocationTarget
JaxbTest.generateTests()[81][1] » InvocationTarget

Failure on JaxbTest.generateTests()[96][1] » InvocationTarget has not been resolved. Refer to discussion: #6005

Comment thread pom.xml Outdated
@dmatej

dmatej commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

One test is still failing. I tried to rebase and update your PR, but I don't have permissions to push to your branch.
The last failing test fails since Jettison 1.3.8.

@dmatej

dmatej commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

dmatej referenced this pull request in jettison-json/jettison Jul 23, 2026
@dmatej

dmatej commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

And here is the fix: jettison-json/jettison#121

@stecurran-est Could you give me permissions to push to your branch, so I could finish it after Jettison merges the fix and releases new version?

@dmatej dmatej added the bug Something isn't working label Jul 23, 2026
  This PR updates Jettison usage and related build configuration to address security issues.
  Includes fix to resolve Jettison import issue after change of scope. Jersey 2.x branch.

  Changes
  uplift org.codehaus.jettison:jettison from 1.3.7 → 1.5.2 to resolve the following CVEs:
  CVE-2022-40149
  CVE-2022-40150
  CVE-2022-45685
  CVE-2022-45693
  CVE-2023-1436

  Set Jettison to provided scope to avoid bundling it into artifacts and
  prevent inclusion of vulnerable versions.
  Commented out bookmark, bookmark-em, and simple-console from the
  examples build. These modules import org.codehaus.jettison.json
  classes directly, which are no longer available at compile time
  after changing Jettison to provided scope.

  Add Jettison with test scope in e2e-entity to fix test compilation.

  Correct pre-existing Surefire config typo:
  <classpathDependencyExcludes> → <classpathDependencyExclude>.
@stecurran-est

stecurran-est commented Jul 23, 2026

Copy link
Copy Markdown
Author

And here is the fix: jettison-json/jettison#121

@stecurran-est Could you give me permissions to push to your branch, so I could finish it after Jettison merges the fix and releases new version?

Hi @dmatej
I made updates and pushed changes before seeing your latest comment. If jettison-json/jettison#121 gets merged and released, I can bump the version and push again.

Note: I made an additional change where I have commented out bookmark, bookmark-em, and simple-console from the examples build as these modules import org.codehaus.jettison.json classes directly, which are no longer available at compile time after changing Jettison to provided scope.

Let me know what you think.

@dmatej

dmatej commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

I have reverted the change from compile to provided, not sure why you made it, but it is a breaking change. On the other hand if nothing broke without it, we can just add it to those modules you commented out instead of disabling them. So lets keep it as provided, I will just enable those examples again.

My build passed now, so for now I can still create a PR to your branch and we can pause until the Jettison will be released.

@dmatej

dmatej commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

@stecurran-est Hmm, unfortunately your repository doesn't allow me to create PRs and I cannot push to this PR too. My branch rebased to your is here, you can merge it on your own, build passed, I just had to use -rf three times as Jetty sometimes doesn't free ports fast enough after tests.

You can merge or cherrypick it (maybe better):

git checkout fix/jettison_2x
git fetch git@github.com:dmatej/jersey.git fix/jettison_2x
git cherry-pick 5d0a062c4cd31c28fcb0d9fdfb19a78baa13caf0
git push git@github.com:Nordix/jersey.git

- Until the Jettison is really released, you can override the version with
  -Djettison.version=1.5.7-SNAPSHOT after you build it locally including
  the fix.
- Colours.getColourListAsJSON has to declare or catch the JSONException now
- Enabled and fixed examples disabled in previous commit
- Deleted commented out examples which already did not exist
- Fixed dependency scopes of jettison

Signed-off-by: David Matějček <david.matejcek@omnifish.ee>
@stecurran-est
stecurran-est marked this pull request as ready for review July 24, 2026 11:22
@dmatej

dmatej commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

I will rerun the license check bit later, we have a gitlab issue for this; it will be removed from PR validations, and reviewers will run it manually, or it will be executed on daily basis. There's a problem with the load of endpoints queried by the maven plugin - when we ask too often, we are blacklisted.

@dmatej

dmatej commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

@mkarg @arjantijms Can you approve this too? 2.x still requires two approvals.

@dmatej
dmatej merged commit a4a74ba into eclipse-ee4j:2.x Jul 25, 2026
7 of 10 checks passed
dmatej added a commit that referenced this pull request Jul 25, 2026
- prints ie. this:
  Jul 23, 2026 7:29:03 PM org.glassfish.jersey.test.spi.TestHelper lambda$toTestContainer$3
  INFO: Invoking test jaxbTest (SimpleBean, JsonbTestProvider).test
- Before that it was impossible to find out which test failed.
- Useful for PR #6035

Signed-off-by: David Matějček <david.matejcek@omnifish.ee>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants