-
Notifications
You must be signed in to change notification settings - Fork 11
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
Don't work inside JAR #11
Comments
Inside the isJarFile method can you try and print the debug statement here? private boolean isJarFile(URL jarUrl) {
// ...
catch (IOException | IllegalStateException | SecurityException e) {
logger.debug("This is not a JAR file due to {}", e.getMessage()); <------- here
}
// ...
} Or maybe it doesn't throw an exception but fails due to lack of manifest file within the JAR due to this code: private boolean isJarFile(URL jarUrl) {
// ...
// Successfully opened the jar file. Check if there's a manifest
// This is probably not necessary
Manifest manifest = jarFile.getManifest();
if (manifest != null) {
return true;
} Do you have a manifest file inside your JAR? |
The problem was . That I had spring boot jar. In normal jar structure, all work fine |
Is this problem resolved then @alabotski? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's my resource folder
![image](https://user-images.githubusercontent.com/439337/127128157-ba427fa9-7045-44d0-8fc6-bca20e437dc8.png)
My code
When I run it in Idea all work fine
When I run it from jar
I have such error
Caused by: java.io.IOException: Failed to list contents of file:/Users/XXX/Workspace/word/build/libs/word-1.0-SNAPSHOT.jar!/BOOT-INF/classes!/upload
ResourceLoader.getThePathToTheJarWeAreIn(TableConfigFactory.class) return such string
12:08:27.882 [main] INFO com.test.TableConfigFactory - jar:file:/Users/XXX/Workspace/word/build/libs/word-1.0-SNAPSHOT.jar!/BOOT-INF/classes!/
And
return false =(
The text was updated successfully, but these errors were encountered: