2016-10-02 32 views
-5

我GIT克隆spring-boot並想開始spring-boot-sample-web-ui,導入它的IntelliJ IDEA和運行SampleWebUiApplication後,首先我遇到了這個錯誤提供可以成功運行的樣本非常困難或者春天很難自然使用嗎?

Caused by: java.lang.ClassNotFoundException: org.apache.juli.logging.LogFactory 

然後加入這個依賴

<dependency> 
     <groupId>org.apache.tomcat.embed</groupId> 
     <artifactId>tomcat-embed-logging-juli</artifactId> 
    </dependency> 

運行它又有另一個錯誤

Caused by: java.lang.ClassNotFoundException: org.springframework.http.client.support.BasicAuthorizationInterceptor 

是否提供可以開始成功的樣本完全是如此困難或者只是春天很難自然使用?

回答

0

如果您是Spring/Spring Boot的新手,推薦使用的方法是查看Getting Started guides。我還沒有遇到任何問題,並讓他們正常工作。根據你列出的樣本,我猜Serving Web Content with Spring MVC將是一個很好的看看。

我在Eclipse的本地環境中嘗試了spring-boot-sample-web-ui項目。我沒有遇到任何問題,因此它看起來可能是您在IntelliJ中導入/加載項目的方式的問題。

-1

我在POM

 <parent> 
-    <!-- Your own application should inherit from spring-boot-starter-parent --> 
       <groupId>org.springframework.boot</groupId> 
-    <artifactId>spring-boot-samples</artifactId> 
-    <version>1.4.0.BUILD-SNAPSHOT</version> 
+    <artifactId>spring-boot-starter-parent</artifactId> 
+    <version>1.4.0.RELEASE</version> 
     </parent> 
+0

不知道從哪裏得到這個例子中解決它通過改變父母,但我不認爲任何例子,是旨在通過快照構建版本使用。 – g00glen00b