關於 IDEA 啟動 springboot 項目異常 - Disconnected from the target VM, address: '127.0.0.1:59770', transport: 'socket'


關於 IDEA 啟動 springboot 項目異常 - Disconnected from the target VM, address: '127.0.0.1:59770', transport: 'socket'

啟動springboot項目報錯如下:

Connected to the target VM, address: '127.0.0.1:55043', transport: 'socket'

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.4.0.RELEASE)

八月 02, 2019 11:28:31 上午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Tomcat
八月 02, 2019 11:28:31 上午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/8.5.4
八月 02, 2019 11:28:31 上午 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring embedded WebApplicationContext
八月 02, 2019 11:28:32 上午 org.apache.catalina.core.StandardService stopInternal
信息: Stopping service Tomcat
Disconnected from the target VM, address: '127.0.0.1:55043', transport: 'socket'

Process finished with exit code 1

問題排查步驟:

001
  1. 首先確認logback.xml配置(當然你也可能使用的是其他log配置文件,但是思路是一樣的)是否有問題。因為這里沒有打印出錯誤日志。
  2. 我這里配置文件有問題,導致錯誤日志沒有輸出。所以無法定位問題。修改之后問題就清楚了。
....
Caused by: java.lang.NullPointerException: null
	at com.t.i.c.ChannelTrans.<clinit>(ChannelTrans.java:42) ~[classes/:na]
	... 24 common frames omitted
Disconnected from the target VM, address: '127.0.0.1:55069', transport: 'socket'

Process finished with exit code 1
002
  1. 假如上面說的配置沒有問題,那么對於沒有日志輸出的情況,最后一個辦法就是一步一步debug進去。
  2. 你同樣也可以找到問題從哪被拋出,然后被哪里吞掉了錯誤日志。

最后,我這里想總結一下
網上查了一下資料關於這個錯誤的問題,回答都是maven版本不一致導致。
雖然我不清楚那種解決方案到底是解決了什么問題。但肯定對我這個問題是沒有任何幫助的。
所以我覺得直接給結果,不如把處理問題的思路給出來,這樣后續有人碰到問題可以按着思路來排查問題,而不是拿結果去套過程。
ps:說了這么多,還不是因為自己寫代碼不細心引起的[/糗大了]...


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM