-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
Leif John Korshavn opened SPR-1631 and commented
My project wanted to use PathMatchingResourcePatternResolver to find certain xml-files in the classpath. Everything worked just fine for both file-system and jar-files until we deployed the application on WebSphere. Turns out WAS returns from URL.getProtocol() the string "wsjar" for jar-files (bundled in ear).
This makes the PathMatchingResourcePatternResolver treat the wsjar-entry like a file-system file, which is not, of course leading to the error:
Caused by: java.io.FileNotFoundException: URL [wsjar:file:/C:/IBM/WebSphere/AppServer/profiles/devel/installedApps/XPPC2270Node01Cell/nics-core.ear/nics-core-SNAPSHOT.jar!/typeresolver/] cannot be resolved to absolute file path because it does not reside in the file system: wsjar:file:/C:/IBM/WebSphere/AppServer/profiles/devel/installedApps/XPPC2270Node01Cell/nics-core.ear/nics-core-SNAPSHOT.jar!/typeresolver/
at org.springframework.util.ResourceUtils.getFile(ResourceUtils.java:173)
at org.springframework.core.io.UrlResource.getFile(UrlResource.java:118)
at org.springframework.core.io.support.PathMatchingResourcePatternResolver.doFindPathMatchingFileResources(PathMatchingResourcePatternResolver.java:382)
at org.springframework.core.io.support.PathMatchingResourcePatternResolver.findPathMatchingResources(PathMatchingResourcePatternResolver.java:265)
at org.springframework.core.io.support.PathMatchingResourcePatternResolver.getResources(PathMatchingResourcePatternResolver.java:202)
at no.bbs.common.type.TypeResolver.<clinit>(TypeResolver.java:35)
... 69 more
I could find no documentation anywhere as to what makes "wsjar" differ from "jar".
My workaround is to implement the classpath-search myself, treating "wsjar" like "jar.
But I would very much appreciate support for IBM¨'s url-protocol wsjar.
Best regards!
Affects: 1.2.6