Both of these solutions ultimately boil down to new URL(environment.getRootUrl(),url.getPath());. However, that only works when the root is an exploded archive, at least in my testing. If environment.getRootUrl() resolves to a file, then what I see is creating the new, relative URL creates the URL relative to the directory containing the archive root. So, for example... let's say we have a root URL of "file://the/path/to/the.par" and that that par defines a <jar-file/> entry referencing "META-INF/entities.jar". So that call effectively becomes new URL( "file://the/path/to/the.par", "META-INF/entities.jar" ). In my testing, that ultimately becomes: "file://the/path/to/META-INF/entities.jar". I had to add very specific handling for resolution relative to an archive using JAR protocol URL handling and its "!/" syntax |