項目中使用了springboot2.*版本,結果發現域名中包含下劃線的時候,比如adc_test.***.com ,結果接直接返回400了。結果發現這個是在tomcat 版本在8.5.31以上都會出現問題
找到個問題了接下來就是想解決方案,於是想着把tomcat 的版本給退回去,網上找了下資料,說是pom文件中配置tomcat的版本就可以了
<tomcat.version>8.0.4</tomcat.version>
結果發現啓動不了,報錯
Caused by: org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.getWebServerFactory(ServletWebServerApplicationContext.java:204)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:178)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:152)
... 16 common frames omitted
查了一圈,最好找到資料說是sringboot2.*只支持tomcat8.5.* 以上的版本。
最後調整上面的tomcat 的版本高於8.5.* 但是低於8.5.31 即可。