18

I generated a Spring Boot application with jHipster, added some code from my previous project (non-jhipster project) and tried to run it using IDEA. First I got an error message similar to this, saying "Command line is too long.." (I am running Windows 10 x64). I clicked enable, but then I got an error like this.:

"C:\Program Files\Java\jdk1.8.0_144\bin\java" -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:51351,suspend=y,server=n -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=51350 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true -Dfile.encoding=UTF-8 -classpath C:\Users\User\AppData\Local\Temp\classpath.jar com.test.pc.TestPartsComposerApp
Connected to the target VM, address: '127.0.0.1:51351', transport: 'socket'
The Class-Path manifest attribute in C:\Users\User\AppData\Local\Temp\classpath.jar referenced one or more files that do not exist: .... Extremely long list of jars
07:48:56.779 [main] DEBUG org.springframework.boot.devtools.settings.DevToolsSettings - Included patterns for restart : []
07:48:56.779 [main] DEBUG org.springframework.boot.devtools.settings.DevToolsSettings - Excluded patterns for restart : [/spring-boot-starter/target/classes/, /spring-boot-autoconfigure/target/classes/, /spring-boot-starter-[\w-]+/, /spring-boot/target/classes/, /spring-boot-actuator/target/classes/, /spring-boot-devtools/target/classes/]
07:48:56.779 [main] DEBUG org.springframework.boot.devtools.restart.ChangeableUrls - Matching URLs for reloading : []

07:48:57.570 [restartedMain] DEBUG org.springframework.boot.logging.ClasspathLoggingApplicationListener - Application failed to start with classpath: []

After I tried with ./mvnw:

The Class-Path manifest attribute in C:\Users\User\.m2\repository\com\sun\xml\bind\jaxb-impl\2.2.3-1\jaxb-impl-2.2.3-1.jar referenced one or more files that do not exist: C:\Users\User\.m2\repository\com\sun\xml\bind\jaxb-impl\2.2.3-1\jaxb-api.jar,C:\Users\User\.m2\repository\com\sun\xml\bind\jaxb-impl\2.2.3-1\activation.jar,C:\Users\User\.m2\repository\com\sun\xml\bind\jaxb-impl\2.2.3-1\jsr173_1.0_api.jar,C:\Users\User\.m2\repository\com\sun\xml\bind\jaxb-impl\2.2.3-1\jaxb1-impl.jar
The Class-Path manifest attribute in C:\Users\User\.m2\repository\org\liquibase\liquibase-core\3.5.3\liquibase-core-3.5.3.jar referenced one or more files that do not exist: C:\Users\User\.m2\repository\org\liquibase\liquibase-core\3.5.3\lib\snakeyaml-1.13.jar
07:53:54.295 [main] DEBUG org.springframework.boot.devtools.settings.DevToolsSettings - Included patterns for restart : []
07:53:54.295 [main] DEBUG org.springframework.boot.devtools.settings.DevToolsSettings - Excluded patterns for restart : [/spring-boot-starter/target/classes/, /spring-boot-autoconfigure/target/classes/, /spring-boot-starter-[\w-]+/, /spring-boot/target/classes/, /spring-boot-actuator/target/classes/, /spring-boot-devtools/target/classes/]
07:53:54.295 [main] DEBUG org.springframework.boot.devtools.restart.ChangeableUrls - Matching URLs for reloading : [file:/C:/workspace/jh-fpc/TestPartsComposer/target/classes/]
07:53:55.295 [restartedMain] DEBUG org.springframework.boot.logging.ClasspathLoggingApplicationListener - Application failed to start with classpath: [file:/C:/workspace/jh-fpc/TestPartsComposer/target/classes/]

I posted my pom.xml here.

I created a completely new project, and started adding the maven dependencies I had one by one and Ran the project after every step. The problem with the classpath occurs, when I add BOTH spring-batch and guava to the pom.

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-batch</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
<dependency>
    <groupId>com.google.guava</groupId>
    <artifactId>guava</artifactId>
    <version>${guava-core.version}</version>
</dependency>
szab.kel
  • 2,356
  • 5
  • 40
  • 74
  • 1
    Have you tried to force IDEA to reread all maven dependencies https://stackoverflow.com/q/9980869/1032167 or clean and rebuild? – varren Oct 06 '17 at 07:02
  • @varren I even deleted my .m2 directory, and let maven to download everything again. But I just added the main reason for the problem, don't know why it causes it tbh. – szab.kel Oct 06 '17 at 07:03
  • 1
    I have the same issue with liquibase but it is not blocking the application startup, you can ignore that message (bug https://liquibase.jira.com/browse/CORE-3046) have you tried `mvn clean install` and then `mvn spring-boot:run` ? – Paizo Oct 18 '17 at 07:42
  • @Paizo I did tried that, but my problem was not with liquibase and maven could not even compile it. – szab.kel Oct 18 '17 at 07:45

9 Answers9

17

I had this same problem in a jHipster application with the same error messages and for me the root cause for me was wrong formatting (indentation) of spring mail settings in application-dev.yml. I just copy/pasted the settings from another project and IntelliJ indented them a bit differently than they were in original code and because of that they could not be resolved.

Those "manifest attribute" things appear every time when starting the application but at least for me they were not related to the real issue. Hope this helps to get to the root of the cause! Cheers,

koni123
  • 171
  • 4
  • 4
    I checked my `application-*.yml` files and discovered that it does not start due to a `tab` character. I inserted 4 spaces instead and it worked again. – kiltek Jan 23 '19 at 13:23
  • This could be the real answer after all, but I can't confirm it, because I no longer experience the issue. – szab.kel Jul 12 '19 at 08:51
  • I have experienced a very similar problem with spring. After hours of debugging it came down to a faulty yml. In the first case it was because of indentation, in the other case it was becuase I had defined the same field multiple time. Beaware of setups with multiple yml files, e.g., in Tomcat multiple yml are processed – ormurin Feb 12 '20 at 14:50
6

This error message is output by ClasspathLoggingApplicationListener#onApplicationEvent

But it does not output the real reason of the error.

So, you should start your app in debug mode, and add a breakpoint at this line, then you can check event.exception, and find out what is the real error happened.

This problem wasted me like 30 minutes.... Hope this answer can save someone a little time

Li Ying
  • 2,261
  • 27
  • 17
  • 1
    I could not set a breakpoint easily so I copied ClasspathLoggingApplicationListener's source code into my application into a org.springframework.boot.context.logging package. In the ClasspathLoggingApplicationListener's onApplicationEvent method I added printing the exception to stdout. Now I see the causing exception in the logs. I am aware that this is a crazy solution. – Markus Peröbner Oct 30 '20 at 11:44
2

Same issue, I just forgot to set spring.profiles.active in application.properties and I have multiple application-*.properties

akuma8
  • 4,160
  • 5
  • 46
  • 82
2

Remove the dependency spring-boot-devtools

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
Anoyi
  • 41
  • 4
1

Check your Main.class path: enter image description here

Your Main.class need be in custom package. If in your Main.class does not contain an entry "package ...", you will get an error.

0

I had the same problem with a JHipster(6.4.1) application, and following the suggestion of @koni123 I found that I had accidentally duplicated the XML declaration in logback-spring.xml.

After fixing the problem I can see that the manifest warning is still printed on startup, so this is just a red herring.

Simon Dyson
  • 625
  • 5
  • 7
0

I also had this problem in Spring, and it seems that the root cause was a conflicting SLF4J dependency, which I had in my pom, with a different version from the one Spring uses natively.

Sir Beethoven
  • 348
  • 1
  • 8
-1

I had the same issue with jhipster @4.10.2 & the solution what I got is here,

As @koni123 rightly said it is something to do with application-dev.yml, when i compared this file with the previous file version found that "spring.jpa.hibernate.format_sql: true" was giving me issue. Once i removed it from application-dev.yml it resolved my problem. Hope this helps.

Sinto
  • 3,915
  • 11
  • 36
  • 70
Ewan
  • 1
-1

be sure that you have the CONSOLE appender active in you logger. That will tells you what the problem really is in the Eclipse console

<root level="info">
        <appender-ref ref="CONSOLE" /> 
        <appender-ref ref="FILE" />
</root>
Nuñito Calzada
  • 4,394
  • 47
  • 174
  • 301