-
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
Overuse of FileID.isArchive() and inability to deal with packed jars without .jar extension #8999
Comments
I'm conflicted about how to fix this one.... If But the probe doesn't work anyway, so going for an expensive Maybe we rename it to |
This is Jetty 12. Packed jars, aka Pack200, is unsupported by the JVM. Pack200 was removed in JDK 14 - https://bugs.openjdk.org/browse/JDK-8232022 Also, Eclipse Equinox no longer downloads / uses |
@joakime not sure how your comment is related? This issue is that we have a war file that we need to deploy, that just happens to not have a ".war" nor ".jar" extension. We could deploy that in jetty<=11, because we would try any non-directory file as a |
From the original comment ...
That, "packed jar format" (aka Pack200) is not supported anymore in JDK 17. Supporting WAR files is a useful thing for sure. |
Lets strip isArchive() from the ResourceFactory implementations and see what happens. |
Opened PR #9002 |
Sorry if my phraseology confused you. I did not mean pack200, just an assembled jar that does not have a
|
Fixed. |
jetty-12.0.x
Line 240 of
ResourceFactory
we test if the uri has an appropriate file extension withFileID.isArchive
.Then at line 244 we call
URIUtil.toJarFileUri
, which also tests if the uri has an appropriate extension:We don't need to do the test multiple times.
Moreover, the
FileID.isArchive
method does not work with files that are actually packed jar format, but missing the.jar
extension, for example as seen withEquinox
in the osgi environment. I tried modifying the method to also try theFiles.probeContentType
method, but it failed to detect a filetype for these types of files. Do we really need to check the file extension? If you make a uri into ajar:file
uri and its the wrong type of file, then using it will fail. Same thing for theJarFileResource
.The text was updated successfully, but these errors were encountered: