-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"not an allowed scheme" for GraalVM Native-Image resource:-URIs #11040
Labels
Bug
For general bugs on Jetty side
Comments
kohlschuetter
added a commit
to kohlschuetter/jetty.project
that referenced
this issue
Dec 11, 2023
kohlschuetter
added a commit
to kohlschuetter/jetty.project
that referenced
this issue
Dec 11, 2023
joakime
added a commit
that referenced
this issue
Dec 13, 2023
* Using ResourceFactoryInternals.isSupported(URI) instead.
@kohlschuetter can you see if PR #11057 is enough for you? |
joakime
added a commit
that referenced
this issue
Dec 14, 2023
Merged PR #11057 |
github-project-automation
bot
moved this from 🏗 In progress
to ✅ Done
in Jetty 12.0.5 - FROZEN
Dec 14, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Jetty version(s)
12.0.4
Jetty Environment
tested with ee10
Java version/vendor
(use: java -version)
java version "21.0.1" 2023-10-17
Java(TM) SE Runtime Environment Oracle GraalVM 21.0.1+12.1 (build 21.0.1+12-jvmci-23.1-b19)
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 21.0.1+12.1 (build 21.0.1+12-jvmci-23.1-b19, mixed mode, sharing)
OS type/version
any, macOS 14
Description
In PR #9136, we landed on a change to support GraalVM Native-Image resource: path URIs. Unfortunately, that seems to no longer completely work on recent GraalVM versions, or maybe I'm hitting code that I haven't triggered before.
How to reproduce?
Try resolving
ResourceFactory.root().newResource(new URI("resource:/path/to/some/resource"))
(which is the new GraalVM resource scheme). Make sure you try this from a native-image environment.You'll get:
The reason for this exception is that
PathResource
has its own set of allowed URI schemes, independent of what is defined inResourceFactoryInternals
. Our previous workaround no longer fully works because Graal issue 5720 was fixed, so we no longer use our workaroundGraalIssue5720PathResourceFactory
.A proposed fix is to register the
resource:
scheme fromResourceFactoryInternals
if we detect we're running in native-image.The text was updated successfully, but these errors were encountered: