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
Let's say I have a fatjar (webapp with jetty inside) webapp-fat.jar,
which internally includes an api.jar,
which itself includes an api-impl.jar and uses JCL to load classes and resources from it through its specific classloader.
When a class of api-impl.jar tries to load one of its internal resource (say some .properties or .xml), JCL's JarResources.getResourceURL(...) is invoked, which delegates to URL(...) constructor, which in turn delegates to sun's sun.net.www.protocol.jar.Handler.parseURL(URL, String, int, int).
This was working well Java 8u221. but since Java8u241, Sun's sun.net.www.protocol.jar.Handler.parseURL(URL, String, int, int) raises the following exception :
java.net.MalformedURLException: Nested JAR URLs are not supported
complaining that nested JAR URLs are not supported any more.
Indeed, when looking at the URL given to sun.net.www.protocol.jar.Handler.parseURL(...), the resource URL looks like this :
JCL version used : 2.7
Let's say I have a fatjar (webapp with jetty inside)
webapp-fat.jar
,which internally includes an
api.jar
,which itself includes an
api-impl.jar
and uses JCL to load classes and resources from it through its specific classloader.When a class of
api-impl.jar
tries to load one of its internal resource (say some.properties
or.xml
), JCL'sJarResources.getResourceURL(...)
is invoked, which delegates toURL(...)
constructor, which in turn delegates to sun'ssun.net.www.protocol.jar.Handler.parseURL(URL, String, int, int)
.This was working well Java 8u221. but since Java8u241, Sun's
sun.net.www.protocol.jar.Handler.parseURL(URL, String, int, int)
raises the following exception :java.net.MalformedURLException: Nested JAR URLs are not supported
complaining that nested JAR URLs are not supported any more.
Indeed, when looking at the URL given to
sun.net.www.protocol.jar.Handler.parseURL(...)
, the resource URL looks like this :jar:jar:file:/webapp-fat.jar-_ws-any-/webapp/WEB-INF/lib/api.jar!/api-impl.jar!/some-api-impl-resource.xml
Does JCL provide a way to deal with such case ?
See also this stackoverflow topic : MalformedURLException in Java JDK 8 when trying to create an URL
The text was updated successfully, but these errors were encountered: