bootRun fails when home directory contains spaces (Windows only)
See original GitHub issueOverview of the issue
When I run gradlew, I obtain the following error:
:bootRun
java.lang.NoClassDefFoundError: org/springframework/core/env/Environment
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: org.springframework.core.env.Environment
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 7 more
Motivation for or Use Case
The Web App simply do not execute (blocking ?)
Reproduce the error
After an analysis, the gradle directory must contains spaces (hence 99% of the time the Home directory) to reproduce
Related issues
No
Suggest a Fix
I fixed the build.gradle pathingJar (shouldn’t be patching by the way ?) by adding ".replaceAll(’ ‘,’%20’):
doFirst {
manifest {
attributes 'Class-Path': configurations.runtime.files.collect {
it.toURL().toString().replaceFirst(/file:\/+/, '/') // .replaceAll(' ','%20')
}.join(' ')
}
}
JHipster Version(s)
j-hipster-app-2@0.0.0 C:\tmp\jHipsterApp2
`-- generator-jhipster@4.0.2
JHipster configuration, a .yo-rc.json
file generated in the root folder
{
"generator-jhipster": {
"jhipsterVersion": "4.0.2",
"baseName": "jHipsterApp2",
"packageName": "com.itemis.jhipster",
"packageFolder": "com/itemis/jhipster",
"serverPort": "8080",
"authenticationType": "session",
"hibernateCache": "ehcache",
"clusteredHttpSession": false,
"websocket": false,
"databaseType": "sql",
"devDatabaseType": "h2Memory",
"prodDatabaseType": "mysql",
"searchEngine": "elasticsearch",
"messageBroker": false,
"buildTool": "gradle",
"enableSocialSignIn": false,
"rememberMeKey": "d2555953206e72c585d3f45577dc79bec812c207",
"useSass": true,
"clientPackageManager": "yarn",
"applicationType": "monolith",
"testFrameworks": [
"gatling",
"cucumber"
],
"jhiPrefix": "jhi",
"enableTranslation": true,
"nativeLanguage": "en",
"languages": [
"en",
"nl"
],
"serviceDiscoveryType": false,
"clientFramework": "angular1"
}
}
Entity configuration(s) entityName.json
files generated in the .jhipster
directory
ls: no such file or directory: .jhipster/*.json
Browsers and Operating System
java version “1.8.0_101” Java™ SE Runtime Environment (build 1.8.0_101-b13) Java HotSpot™ 64-Bit Server VM (build 25.101-b13, mixed mode)
git version 2.9.3.windows.2
node: v7.5.0
npm: 4.1.2
bower: 1.8.0
gulp: [09:20:27] CLI version 3.9.1 [09:20:27] Local version 3.9.1
yeoman: 1.8.5
yarn: 0.19.1
Docker version 1.13.0, build 49bf474
docker-compose version 1.10.0, build 4bd6f1a0
- Checking this box is mandatory (this is just to show you read everything)
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Spring bootRun failing with mysterious error after converting ...
So I solved this issue. First of all, see my edits. It's important to have a try catch about Spring's run method and...
Read more >Spring Boot run configuration | IntelliJ IDEA Documentation
The Spring Boot run configuration defines how to run your Spring Boot ... IDEA will only update the changed classes in the output...
Read more >The Executable Jar Format - Spring
It provides a list of jar names (including the directory) in the order that they should be added to the classpath. Each line...
Read more >Current Directory Contains Spaces in its Path (SOLVED)
CommandPrompt #CurrentDirectoryContainsSpacesthe image path must not contain any spaces error,current directory, unable to execute files in ...
Read more >Command-Line Interface - Gradle User Manual
Running gradle tasks gives you a list of the main tasks of the selected project. · By default, this report shows only those...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Sure, this modification should not be very difficult.
----- Original Message ----- From: “Frederik Hahne” notifications@github.com To: “jhipster/generator-jhipster” generator-jhipster@noreply.github.com Cc: “Christophe Moine” christophe.moine@free.fr, “Author” author@noreply.github.com Sent: Friday, 10 February, 2017 6:55:38 PM Subject: Re: [jhipster/generator-jhipster] bootRun fails when home diretory contains spaces (Wndows ionly) (#5164)
Would you mind to do a PR with your fix?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub , or mute the thread .
Closed as PR is merged