Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
spring-projects-issues opened this issue Nov 30, 2009 · 1 comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: duplicate A duplicate of another issue

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Nov 30, 2009

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

@spring-projects-issues
Copy link
Collaborator Author

Alexander Schäl commented

Sorry about the accidentally double posting of the WebStart issue! =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

1 participant