← Back to Pull requests

Fix Web Service Listener SOAP requests failing on JDK 19+ #508

Closed
unknown closed this pull request without merging on Nov 01, 2026 20:51 UTC
View on GitHub
unknown unknown commented on Oct 23, 2026 12:28 UTC
Author

What

  • WebServiceReceiver now builds its HttpServer worker pool with a ThreadFactory that sets each worker's context classloader to the one that loaded WebServiceReceiver.

  • WebServiceReceiverTest: starts a real HttpServer on that pool and checks the request thread carries the given classloader.

  • WebServiceListenerTest (smoke): deploys a Web Service Listener on port 8081 and POSTs a SOAP envelope to it from the harness container.
  • Why

    On JDK 19 and later, every SOAP request to a Web Service Listener fails with Unable to create SAAJ meta-factory, while GET ?wsdl keeps returning 200.

    The JDK HttpServer creates worker threads from its dispatcher thread. Since JDK 19 that thread gets the system classloader instead of inheriting the caller's, so the workers can't see server-lib, and SAAJ's context-classloader lookup misses the implementation. On JDK 18 and earlier the workers inherited the server's classloader, which this restores. No -Xbootclasspath/a workaround is needed.

    This was reported against the BridgeLink fork, where it was root-caused and fixed in a similar way: https://github.com/Innovar-Healthcare/BridgeLink/issues/205. Their fix pins the channel's resource classloader on the workers. This PR uses the server classloader instead, which keeps the behaviour from before JDK 19 and doesn't make channel libraries visible to the SOAP stack.

    The fixture tests can't catch this, because they submit messages through the client API and never touch the listener's worker threads. That's why the smoke test is a Java test.

    Testing

  • ./gradlew :server:test --tests 'com.mirth.connect.connectors.ws.*' passes. With the fix's setContextClassLoader line removed, WebServiceReceiverTest fails (expected URLClassLoader, was AppClassLoader).

  • ci/runtests.sh alpine-temurin21-derby: 13/13 pass. With the fix line removed (and unit tests skipped in the image build), WebServiceListenerTest fails with HTTP 500 and the other 12 pass.

  • Not tested: MTOM/attachment requests, and the other CI configurations locally.
  • 🤖 Generated with Claude Code

    Diff: 267 lines (+200 / -67) across 3 files Reviewer: pacmano1 Review duration: 13462m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.39) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 267 lines diff across 3 files
    0.39
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.334
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #508"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 39.4% (MEDIUM) · Higher = larger blast radius
    39.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 15.6% · Safe to merge
    15.6%