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

Boot Dashboard cannot start app when Eclipse project name contains spaces #403

Closed
aritzbastida opened this issue Jan 14, 2020 · 3 comments
Closed
Milestone

Comments

@aritzbastida
Copy link

aritzbastida commented Jan 14, 2020

Boot Dashboard (STS 4.5) cannot start app when the Eclipse project name contains spaces.

Take, for instance, the attached demo project, with the following pom.xml snippet:

	<artifactId>demo-project</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<name>demo [BREAKS BOOT DASHBOARD]</name>

If we import it into Eclipse as an existing Maven project, and use the name (instead of artifactId) to set the project name, then this name is shown in Boot Dashboard as "demo [BREAKS BOOT DASHBOARD]".

This name breaks the init process with the following message:

Error: Could not find or load main class [BREAKS

For some reason, the main class is not taken into account...

This error did not happen with previous STS versions.

demo-project.zip

@kdvolder
Copy link
Member

I will investigate / debug this issue and see if we can improve on this somehow but... please... do not use spaces in your project names you are really asking for problems. It is kind of a known limitation already. For example when I try to create a project using spaces in its name via the 'New Spring Starter' project wizard.... the wizard will refuse to accept a project name with spaces in it as valid input and won't let you do that.

I will however try and reproduce the issue by importing your sample project and then try to debug exactly where it goes wrong, then maybe try to fix it so it works better.

@kdvolder
Copy link
Member

kdvolder commented Jan 14, 2020

Able to reproduce it. I called my project 'demo with spaces' (not sure about the square brackets in this so to make sure I only dealing with one problem at a time I got rid of them).

When I look at the 'command line' that was used to launch the app in the debug view it shows me this:

/usr/lib/jvm/java-8-oracle/bin/java -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=44013 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=localhost -Dspring.jmx.enabled=true -Dspring.application.admin.enabled=true -Djava.security.egd=file:/dev/./urandom -noverify -XX:TieredStopAtLevel=1 -Dspring.boot.project.name=demo with spaces -Dfile.encoding=UTF-8 -classpath /home/kdvolder/Downloads/demo-project/target/classes:/home/kdvolder/.m2/repository/org/springframework/boot/spring-boot-starter-web/2.2.2.RELEASE/spring-boot-starter-web-2.2.2.RELEASE.jar:/home/kdvolder/.m2/repository/org/springframework/boot/spring-boot-starter/2.2.2.RELEASE/spring-boot-starter-2.2.2.RELEASE.jar:/home/kdvolder/.m2/repository/org/springframework/boot/spring-boot/2.2.2.RELEASE/spring-boot-2.2.2.RELEASE.jar:/home/kdvolder/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/2.2.2.RELEASE/spring-boot-autoconfigure-2.2.2.RELEASE.jar:/home/kdvolder/.m2/repository/org/springframework/boot/spring-boot-starter-logging/2.2.2.RELEASE/spring-boot-starter-logging-2.2.2.RELEASE.jar:/home/kdvolder/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar:/home/kdvolder/.m2/repository/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar:/home/kdvolder/.m2/repository/org/apache/logging/log4j/log4j-to-slf4j/2.12.1/log4j-to-slf4j-2.12.1.jar:/home/kdvolder/.m2/repository/org/apache/logging/log4j/log4j-api/2.12.1/log4j-api-2.12.1.jar:/home/kdvolder/.m2/repository/org/slf4j/jul-to-slf4j/1.7.29/jul-to-slf4j-1.7.29.jar:/home/kdvolder/.m2/repository/jakarta/annotation/jakarta.annotation-api/1.3.5/jakarta.annotation-api-1.3.5.jar:/home/kdvolder/.m2/repository/org/yaml/snakeyaml/1.25/snakeyaml-1.25.jar:/home/kdvolder/.m2/repository/org/springframework/boot/spring-boot-starter-json/2.2.2.RELEASE/spring-boot-starter-json-2.2.2.RELEASE.jar:/home/kdvolder/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.10.1/jackson-databind-2.10.1.jar:/home/kdvolder/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.10.1/jackson-annotations-2.10.1.jar:/home/kdvolder/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.10.1/jackson-core-2.10.1.jar:/home/kdvolder/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.10.1/jackson-datatype-jdk8-2.10.1.jar:/home/kdvolder/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.10.1/jackson-datatype-jsr310-2.10.1.jar:/home/kdvolder/.m2/repository/com/fasterxml/jackson/module/jackson-module-parameter-names/2.10.1/jackson-module-parameter-names-2.10.1.jar:/home/kdvolder/.m2/repository/org/springframework/boot/spring-boot-starter-tomcat/2.2.2.RELEASE/spring-boot-starter-tomcat-2.2.2.RELEASE.jar:/home/kdvolder/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/9.0.29/tomcat-embed-core-9.0.29.jar:/home/kdvolder/.m2/repository/org/apache/tomcat/embed/tomcat-embed-el/9.0.29/tomcat-embed-el-9.0.29.jar:/home/kdvolder/.m2/repository/org/apache/tomcat/embed/tomcat-embed-websocket/9.0.29/tomcat-embed-websocket-9.0.29.jar:/home/kdvolder/.m2/repository/org/springframework/boot/spring-boot-starter-validation/2.2.2.RELEASE/spring-boot-starter-validation-2.2.2.RELEASE.jar:/home/kdvolder/.m2/repository/jakarta/validation/jakarta.validation-api/2.0.1/jakarta.validation-api-2.0.1.jar:/home/kdvolder/.m2/repository/org/hibernate/validator/hibernate-validator/6.0.18.Final/hibernate-validator-6.0.18.Final.jar:/home/kdvolder/.m2/repository/org/jboss/logging/jboss-logging/3.4.1.Final/jboss-logging-3.4.1.Final.jar:/home/kdvolder/.m2/repository/com/fasterxml/classmate/1.5.1/classmate-1.5.1.jar:/home/kdvolder/.m2/repository/org/springframework/spring-web/5.2.2.RELEASE/spring-web-5.2.2.RELEASE.jar:/home/kdvolder/.m2/repository/org/springframework/spring-beans/5.2.2.RELEASE/spring-beans-5.2.2.RELEASE.jar:/home/kdvolder/.m2/repository/org/springframework/spring-webmvc/5.2.2.RELEASE/spring-webmvc-5.2.2.RELEASE.jar:/home/kdvolder/.m2/repository/org/springframework/spring-aop/5.2.2.RELEASE/spring-aop-5.2.2.RELEASE.jar:/home/kdvolder/.m2/repository/org/springframework/spring-context/5.2.2.RELEASE/spring-context-5.2.2.RELEASE.jar:/home/kdvolder/.m2/repository/org/springframework/spring-expression/5.2.2.RELEASE/spring-expression-5.2.2.RELEASE.jar:/home/kdvolder/.m2/repository/org/slf4j/slf4j-api/1.7.29/slf4j-api-1.7.29.jar:/home/kdvolder/.m2/repository/org/springframework/spring-core/5.2.2.RELEASE/spring-core-5.2.2.RELEASE.jar:/home/kdvolder/.m2/repository/org/springframework/spring-jcl/5.2.2.RELEASE/spring-jcl-5.2.2.RELEASE.jar com.example.demo.DemoApplication --spring.output.ansi.enabled=always

The interesting part is this:

-Dspring.boot.project.name=demo
with
spaces

So I think that somehow that argument is being incorrectly split up into multiple arguments because it has spaces. That causes the 'with' to treated as a separate argument and then interpreted incorrectly as the name of the main class.

kdvolder added a commit to spring-attic/spring-ide that referenced this issue Jan 14, 2020
@aritzbastida
Copy link
Author

Thank you for the quick reply (and fix)!!

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

4 participants