[WELD-2800] Don't use jar cache in ServiceLoader.loadServiceFile #3069
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This should resolve https://issues.redhat.com/browse/WELD-2800
java.net.URL.openStream
uses a jar cache. Thus the jar file is kept in memory as long as the Glassfish server is alive, and thus the jar file in "glassfish\domains\domain1\applications" cannot be deleted on windows when the app is undeployed.Workaround: set
URLConnection.setUseCaches(false)
before accessing the InputStream:I pushed it to the 5.1 branch as GlassFish 7.0.18 uses Weld 5.1.3.Final, and I hope that this fix makes it to next Glassfish.
I don't have much git experience and never pushed to a branch, so please be patient with me if I did this wrong ;-)