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

Using a different method to get the absolute path. #69

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

raafaar
Copy link

@raafaar raafaar commented May 26, 2016

The method in this change uses an InputStream instead of a File object.

The use of a method that doesn't depends of a File object, makes possible a deploy into a WebLogic because with WebLogic the configuration files are loaded from a generated jar instead of a file in the filesystem.

The motivation for this change is in this issue: #68

I've tested myself this change with a simple spring boot project, using «gradle bootRun», delploying into a Tomcat server and into a WebLogic server. The three cases worked as expected.

The method in this change uses an InputStream instead of a File object.
The use of a method that doesn't depends of a File object, makes possible a deploy into a WebLogic because with WebLogic the configuration files are loaded from a generated jar instead of a file in the filesystem.
@kawas44
Copy link

kawas44 commented Sep 7, 2017

+1 fix a problem when using SpringBoot and starting the application as an executable Jar.

Original error without this fix was:
java.io.FileNotFoundException: class path resource [myroutes.conf] cannot be resolved to absolute file path because it does not reside in the file system: jar:file:/home/kawas/code/spring/webapp/target/webapp-0.0.1-SNAPSHOT.jar!/BOOT-INF/classes!/myroutes.conf

Could you please review this PR ?

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

Successfully merging this pull request may close these issues.

2 participants