Spring boot 第一個(gè)程序踩的坑

所謂第一個(gè)springboot程序?qū)τ谝粋€(gè)菜鳥(niǎo)來(lái)說(shuō),真的是一波三折,好多事情也說(shuō)不清楚為啥,但是改了它就生效了。


哎,不得不承認(rèn),配置環(huán)境這事對(duì)我來(lái)說(shuō),有點(diǎn)水土不服。

第一個(gè)坑

Add an implementation, such as Hibernate Validator, to the classpath

<dependency>

? ? <groupId>org.hibernate.validator</groupId>

? ? <artifactId>hibernate-validator</artifactId>

?</dependency>

第二個(gè)坑

o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown


網(wǎng)上大部分的解決方案都是加上Tomcat或者是加上web

<dependency>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-starter-web</artifactId>

</dependency>


<dependency>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-starter-tomcat</artifactId>

</dependency>

然并卵,最終的解決方案是需要?jiǎng)h掉springboot下面的文件,和Tomcat下面的文件,然后update maven

參考http://www.itdecent.cn/p/30213fdc523b

主要的問(wèn)題是tomcat沒(méi)有下載完整,雖然STS沒(méi)有報(bào)錯(cuò)。先清除SpringBoot的依賴(打開(kāi)路徑:/home/mo/.m2/repository/org/springframework/boot,把文件清除掉),然后在清除tomcat依賴(路徑:/home/mo/.m2/repository/org/apache/tomcat),然后在STS中用Maven Update項(xiàng)目,然后重新運(yùn)行SpringBoot項(xiàng)目,問(wèn)題解決。這種方法要確保網(wǎng)絡(luò)的通暢


最終看到完整的啟動(dòng)服務(wù)器了,正是開(kāi)頭難啊


hello spring boot


最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容