SpringBoot相關錯誤

1.org.springframework.boot.builder.SpringApplicationBuilder.<init>([Ljava/lang/Object;)Vjava

搭建spring cloud的時候,報如下錯誤:spring

java.lang.NoSuchMethodError: org.springframework.boot.builder.SpringApplicationBuilder.<init>([Ljava/lang/Object;)V

 

 

是因爲spring boot版本兼容性致使的,在pom.xml中修改配置文件,修改前:sql

複製代碼
<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.0.0.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>
複製代碼

修改後:緩存

複製代碼
<parent>
       <groupId>org.springframework.boot</groupId>
       <artifactId>spring-boot-starter-parent</artifactId>
       <version>1.5.3.RELEASE</version>
       <relativePath/> <!-- lookup parent from repository -->
</parent>
複製代碼

 

2.在對程序進行編譯時出現Cannot start process, the working directory 'E:\sparksql33\sparksql3服務器

解決辦法:app

1.點擊導航欄 run----> Edit configurations。而後點擊Application,在Configuration右邊會顯示Working directory,刪除或者設置成合適dircotry就能夠了能夠。spring-boot

2.將 Working directory 刪除或者修改爲$MODULE_DIR$便可。ui

3.點擊右下角apply以及ok。這樣就行了。spa


3.Reason: Failed to convert property value of type 'java.lang.String' to required type 'java.util.Map' for property 'serviceUrl'; nested exception is java.lang.IllegalStateException: Cannot convert value of type 'java.lang.String' to required type 'java.util.Map' for property 'serviceUrl': no matching editors or conversion strategy foundcode

spring Failed to convert property value of type 'java.lang.String' to required type 'int' for proper

這種狀況,看起來好像是 spring 的

org.springframework.beans.factory.config.PropertyPlaceholderConfigurer

類在讀取信息的時候出問題了,把 String 類型的值當成了 int 類型的了

實際上這並非這麼回事,問題在於配置文件的位置配置錯誤,spring 根本沒有找到那個配置文件,因此它報錯了,只不過這個錯誤沒有把問題說明白。

好好檢查你的 配置文件位置是否是配置的正確,下面是配置文件的配置方式

<!-- 引入緩存的配置文件properties -->
<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="ignoreResourceNotFound" value="true" />
<property name="ignoreUnresolvablePlaceholders" value="true" />
<property name="locations">
<list>
<!-- 此位置是相對於:部署後的項目根路徑 -->
<!-- <value>/WEB-INF/cache.properties</value> -->
<!-- 此位置是相對於:文件直接在src 目錄下 -->
<!-- <value>classpath*:cache.properties</value> -->
<!-- 此位置是相對於:文件在目錄下面 -->
<!-- <value>classpath*:cache/cache.properties</value> -->
<value>classpath*:/cache/cache.properties</value>
<!-- 此位置是從服務器環境變量中查找名爲:XXX 的值(例如:file:D:/test/test.properties) -->
<!-- <value>${XXX}</value> -->
<!-- 此位置是相對於:文件系統 -->
<!-- <value>file:D:/test/test.properties</value> -->
</list>
</property>
</bean>

4. Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServlet

相關文章
相關標籤/搜索