Fix Web Service Listener SOAP requests failing on JDK 19+ #508
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
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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
pacmano1
What
WebServiceReceivernow builds its HttpServer worker pool with aThreadFactorythat sets each worker's context classloader to the one that loadedWebServiceReceiver.WebServiceReceiverTest: starts a realHttpServeron 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, whileGET ?wsdlkeeps 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/aworkaround 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'ssetContextClassLoaderline removed,WebServiceReceiverTestfails (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),WebServiceListenerTestfails with HTTP 500 and the other 12 pass.🤖 Generated with Claude Code