2017-10-06 223 views
6

我生成了一个带有jHipster的Spring Boot应用程序,添加了我以前的项目(非jhipster项目)中的一些代码,并尝试使用IDEA运行它。首先,我收到类似于this的错误消息,称“命令行太长..”(我正在运行Windows 10 x64)。我点击启用,但然后我得到了一个这样的错误。:Spring Boot应用程序未能以类路径启动:[]

"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: [] 

后,我试了一下。 /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/] 

我贴我的pom.xmlhere

我创建了一个全新的项目,并开始添加我一个接一个的Maven依赖项,然后在每一步之后都运行项目。类路径的问题发生时,当我添加两个春季批次和番石榴。

<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> 
+0

你有没有试图强制IDEA重新读取所有的maven依赖https://stackoverflow.com/q/9980869/1032167或干净和重建? – varren

+0

@varren我甚至删除了我的.m2目录,并让maven再次下载所有内容。但我只是增加了问题的主要原因,不知道为什么导致它tbh。 – appl3r

+0

我有与liquibase相同的问题,但它不阻止应用程序启动,你可以忽略该消息(bug https://liquibase.jira.com/browse/CORE-3046)你尝试过'mvn clean install'然后'mvn spring-boot:run'? – Paizo

回答

3

我在相同的错误消息的jHipster应用程序有这个同样的问题,对我来说是根本原因对我来说是在应用dev.yml春天邮件设置误格式化(缩进)。我只是复制/粘贴来自另一个项目的设置,并且IntelliJ缩进它们与原始代码中的有点不同,并且因为它们无法解析。

每次启动应用程序时,都会出现这些“显示属性”的东西,但至少对我而言,它们并不涉及真正的问题。希望这有助于找到事业的根源!干杯,

相关问题