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

Incorrect USERLIB cacheDir for spingboot application #131

Closed
ghost opened this issue Aug 24, 2018 · 1 comment
Closed

Incorrect USERLIB cacheDir for spingboot application #131

ghost opened this issue Aug 24, 2018 · 1 comment

Comments

@ghost
Copy link

ghost commented Aug 24, 2018

Hi,
i have notice that there is a bug when you retrieve the cacheDir while starting SpringBoot Application.
If i set the cacheDir like --cache-dir=USERLIB/MyApp then.

i think that instead of

superLauncher.getManifest().cacheDir;

is better to use

this.superLauncher.getManifest().resolveCacheDir(this.getParameters().getNamed())

in the method below, to correctly resolve the USERLIB dir.

private void startApplication() throws Exception {
    if (app != null) {
        ParametersImpl.registerParameters(app, new LauncherParams(getParameters(), superLauncher.getManifest()));
        PlatformImpl.setApplicationName(app.getClass());
        superLauncher.setPhase("Application Init");
        app.start(primaryStage);
    } else {
        // Start any executable jar (i.E. Spring Boot);
        List<LibraryFile> files = superLauncher.getManifest().files;
        String cacheDir = superLauncher.getManifest().cacheDir;
        String command = String.format("java -jar %s/%s", cacheDir, files.get(0).file);
        log.info(String.format("Execute command '%s'", command));
        Runtime.getRuntime().exec(command);
    }
 }
edvin pushed a commit that referenced this issue Aug 28, 2018
@edvin
Copy link
Owner

edvin commented Aug 28, 2018

Thank you, I've committed a fix :)

@edvin edvin closed this as completed Aug 28, 2018
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

No branches or pull requests

1 participant