Skip to content

Spring fails to load ressources via Java Network Launching Protocol (WebStart) since Java6 [SPR-6480] #11146

Closed
@spring-projects-issues

Description

@spring-projects-issues

Alexander Schäl opened SPR-6480 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.6

Issue Links:

4 votes, 4 watchers

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions