Repository navigation
Fall back to the library class loader for classpath resources (2.x) - #1266
Conversation
In OSGi runtimes the thread context class loader cannot see this library's bundled meta-schemas, so resolution fails with FileNotFoundException: classpath:draft/2020-12/schema. The 1.x ClasspathURLStreamHandler chained class loaders; the chain was not carried over in the schema retrieval refactor (#931). The fallback runs only after the TCCL misses, so flat classpath behavior is unchanged, and it is skipped when a custom class loader source is supplied.
|
No blocking findings on PR 1266. Risk: medium-low. Same reason as PR 1265: the patch is small, but it touches ClasspathResourceLoader#getResource, which is on schema/meta-schema loading paths. GitNexus maps the direct Backport quality looks good:
Coverage is appropriate:
Non-blocking gap: this restores the important bundled-resource fallback, but not the full old 1.0.x classpath URL chain’s final system-classloader lookup. I would not block on that for Verification run under Corretto 8:
CI/check-runs are not reported on GitHub for the PR head, so local Java 8 verification is the meaningful gate. Recommendation: approve after CI if required by process; otherwise this |
|
I have reviewed the pull request diff for PR #1266 in the SummaryThis PR addresses a common classloading issue in environments like OSGi or application servers, where the Thread Context Class Loader (TCCL) is set but unable to see the bundled resources of the library itself. The fix introduces a fallback mechanism to use the library's own class loader ( Code Review1.
2.
ConclusionStatus: Approved / LGTM (Looks Good To Me) The code is well-structured, correctly addresses the OSGi visibility edge cases, maintains backward compatibility, and includes solid unit tests. There are no bugs, concurrency issues, or architectural concerns. You can safely merge this PR! |
Backport of #1265 to 2.x; closes #1264. Identical patch and test, Java 8 compatible.