You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using a ClassPathResource to set the keyStoreLocation property, if the resource is located in a jar file a FileNotFoundException is thrown.
Caused by: java.io.FileNotFoundException: class path resource [com/foo/security/foo.keystore] cannot be resolved to absolute file path because it does not reside in the file system: jar:file:/C:/views/java/jboss/server/oneforce/deploy/oba.war/WEB-INF/lib/foo-security.jar!/com/foo/security/foo.keystore
at org.springframework.util.ResourceUtils.getFile(ResourceUtils.java:204)
at org.springframework.core.io.AbstractFileResolvingResource.getFile(AbstractFileResolvingResource.java:52)
at org.springframework.ws.soap.security.wss4j.support.CryptoFactoryBean.setKeyStoreLocation(CryptoFactoryBean.java:88)
org.apache.ws.security.components.crypto.AbstractCrypto has it's own mechanism for locating classpath resources. The following patch will fallback to the ClassPathResource path if can't be resolved to a file.
publicvoidsetKeyStoreLocation(Resourcelocation) throwsIOException {
StringresourcePath = null;
try {
FilekeyStoreFile = location.getFile();
resourcePath = keyStoreFile.getAbsolutePath();
} catch (IOExceptionioe) {
// can't resolve to file on the file system// allow org.apache.ws.security.components.crypto.AbstractCrypt to resolve from resource pathif(locationinstanceofClassPathResource) {
resourcePath = ((ClassPathResource) location).getPath();
} else {
throwioe;
}
}
this.configuration.setProperty("org.apache.ws.security.crypto.merlin.file", resourcePath);
}
Kyle Cronin opened SWS-726 and commented
When using a ClassPathResource to set the keyStoreLocation property, if the resource is located in a jar file a FileNotFoundException is thrown.
org.apache.ws.security.components.crypto.AbstractCrypto
has it's own mechanism for locating classpath resources. The following patch will fallback to the ClassPathResource path if can't be resolved to a file.Affects: 2.0.2
Referenced from: commits 93063cf
The text was updated successfully, but these errors were encountered: