Spring fails to load ressources via Java Network Launching Protocol (WebStart) since Java6 [SPR-6481] #11147
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
status: duplicate
A duplicate of another issue
Alexander Schäl opened SPR-6481 and commented
When started via Java6 WebStart, the Spring PathMatchingResourcePatternResolver tries to handle the URLConnection (wich is in a WebStart context actually an JNLPCachedJarURLConnection) just like a normal file URL. The PathMatchingResourcePatternResolver checks the resources only for a JarURLConnection, any other is handled as a path on the local file system.
So the resource request for "http://service.ACME.com:42/webstart/ressources.jar" (which would be propperly handled by the com.sun.jnlp.JNLPClassLoader) is crippled to "http:\service.ACME.com:42\webstart\ressources.jar", which of course can't be handled by any class loader and logically ends up in an FileNotFoundException due to the destroyed URL syntax.
A solution COULD be to extend the URLConnection type checking at the method doFindPathMatchingJarResources of org.springframework.core.io.support.PathMatchingResourcePatternResolver from JarURLConnection to an JNLPCachedJarURLConnection in order to treat this connection not as a "file:"
Java WebStart 5 used to cache all resources (especially the JAR files listed as resources in the JNLP file) on the local file system and the PathMatchingResourcePatternResolver could access these JAR files using a local path like "file://path/on/local/system". Java WebStart 6 has got another (obfuscated) cache structure - there are no longer any plain JAR files. That's why the JNLPClassLoader returns JNLPCachedJarURLConnection for any JAR resource instead of JarURLConnection like WebStart 5 did.
Affects: 2.5.4
Issue Links:
2 votes, 2 watchers
The text was updated successfully, but these errors were encountered: