You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
openjdk 17.0.11 2024-04-16
OpenJDK Runtime Environment Temurin-17.0.11+9 (build 17.0.11+9)
OpenJDK 64-Bit Server VM Temurin-17.0.11+9 (build 17.0.11+9, mixed mode, sharing)
OS type/version
Linux / Ubuntu
Description
If you have a Resource Base that is a PathResource that points to a FS that doesn't support file mapping, like zipfs, then you are unable to serve files from ResourceHandler.
This works in 12.0.16 just fine.
2025-01-09 13:43:22.809:WARN :oejs.Response:qtp2008106788-169: writeError: status=500, message=java.lang.UnsupportedOperationException, response=ErrorResponse@1e15b2b8{500,GET@2e2db70a http://192.168.1.221:40715/jars/webjars/bootstrap/5.3.3/js/bootstrap.bundle.js HTTP/1.1}
java.lang.UnsupportedOperationException
at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem$1.map(ZipFileSystem.java:1102)
at org.eclipse.jetty.util.BufferUtil.toMappedBuffer(BufferUtil.java:1178)
at org.eclipse.jetty.util.BufferUtil.toMappedBuffer(BufferUtil.java:1171)
at org.eclipse.jetty.http.content.FileMappingHttpContentFactory$SingleBufferFileMappedHttpContent.<init>(FileMappingHttpContentFactory.java:103)
at org.eclipse.jetty.http.content.FileMappingHttpContentFactory.getContent(FileMappingHttpContentFactory.java:78)
at org.eclipse.jetty.http.content.VirtualHttpContentFactory.getContent(VirtualHttpContentFactory.java:60)
at org.eclipse.jetty.http.content.PreCompressedHttpContentFactory.getContent(PreCompressedHttpContentFactory.java:48)
at org.eclipse.jetty.http.content.CachingHttpContentFactory.getContent(CachingHttpContentFactory.java:229)
at org.eclipse.jetty.server.ResourceService.getContent(ResourceService.java:88)
at org.eclipse.jetty.server.handler.ResourceHandler.handle(ResourceHandler.java:174)
at org.eclipse.jetty.server.Handler$Wrapper.handle(Handler.java:740)
at examples.PathMappingServer$PathNameWrapper.handle(PathMappingServer.java:177)
at org.eclipse.jetty.server.handler.PathMappingsHandler.handle(PathMappingsHandler.java:116)
at org.eclipse.jetty.server.Server.handle(Server.java:182)
at org.eclipse.jetty.server.internal.HttpChannelState$HandlerInvoker.run(HttpChannelState.java:672)
at org.eclipse.jetty.server.internal.HttpConnection.onFillable(HttpConnection.java:411)
at org.eclipse.jetty.server.internal.HttpConnection$FillableCallback.succeeded(HttpConnection.java:1688)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:99)
at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:979)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1209)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1164)
at java.base/java.lang.Thread.run(Thread.java:840)
I think the toMappedBuffer should catch UnsupportedOperationException and fallback to non-mapped option.
The text was updated successfully, but these errors were encountered:
We should also consider if a file is too small for memory mapping, per the recommendations in the javadoc linked above.
"For most operating systems, mapping a file into memory is more expensive than reading or writing a few tens of kilobytes of data via the usual read and write methods. From the standpoint of performance it is generally only worth mapping relatively large files into memory."
Jetty version(s)
12.1.0.alpha1
Jetty Environment
core
Java version/vendor
(use: java -version)
OS type/version
Linux / Ubuntu
Description
If you have a Resource Base that is a PathResource that points to a FS that doesn't support file mapping, like zipfs, then you are unable to serve files from ResourceHandler.
This works in 12.0.16 just fine.
I think the
toMappedBuffer
should catchUnsupportedOperationException
and fallback to non-mapped option.The text was updated successfully, but these errors were encountered: