2017-10-06 221 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縮進它們與原始代碼中的有點不同,並且因爲它們無法解析。

每次啓動應用程序時,都會出現這些「顯示屬性」的東西,但至少對我而言,它們並不涉及真正的問題。希望這有助於找到事業的根源!乾杯,

相關問題