Skip to content
This repository has been archived by the owner on Feb 27, 2020. It is now read-only.

Cannot load metadata file packed in JAR #48

Open
captSL opened this issue Jan 24, 2018 · 1 comment
Open

Cannot load metadata file packed in JAR #48

captSL opened this issue Jan 24, 2018 · 1 comment

Comments

@captSL
Copy link

captSL commented Jan 24, 2018

Hi,

in the current version it seems not to be possible to load a metadata file embedded in a JAR, like a packaged Spring Boot application. I get this exception:

java.io.FileNotFoundException: class path resource [saml/idp-meta.xml] cannot be resolved to absolute file path because it does not reside in the file system: jar:file:/test/test.jar!/WEB-INF/classes!/saml/idp-meta.xml

For me it looks like the FilesystemMetadataProvider being used requires a File handle and getting a File handle from a JAR is not possible. Instead, an InputStream should be used.

Can anyone confirm this?

Thanks,
Thorsten

@WalterHillAKQA
Copy link

I have run into the same issue when starting spring boot using java -jar. It appears that running the application this way cannot find files on the classpath using a spring resource getFile method. When the code is changed to use an InputStream, then the file is found

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants