SpringBoot問題集錦

此文件如無特殊說明:springboot均爲2.1.4版本

1.SpringBoot打包成jar後運行提示沒有主清單屬性
參考:https://www.cnblogs.com/niceboat/p/6230448.html
因爲我使用spring-boot-dependencies這個BOM代替了spring-boot-starter-parent這個parent POM(詳見13.2.2. Using Spring Boot without the parent POM)
導致spring-boot-maven-plugin的配置項丟失,使得打包後的jar中的MANIFEST.MF文件缺少Main-Class。
解決:

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <version>${spring.version}</version>
    <executions>
        <execution>
            <goals>
                <goal>repackage</goal>
            </goals>
        </execution>
    </executions>
</plugin>

2.上傳文件出錯(關鍵字:mostPostSize):

在這裏插入圖片描述解決辦法:
在這裏插入圖片描述

3.修改springboot默認文件大小:
在這裏插入圖片描述

4.feign 不支持 Get requestBody的形式解決方法:

<dependency>
     <groupId>io.github.openfeign</groupId>
     <artifactId>feign-httpclient</artifactId>
 </dependency>

未完待續…

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章