1. 程式人生 > >關於tomcat啟動專案時一直卡住無反應的場景之一

關於tomcat啟動專案時一直卡住無反應的場景之一

       最近碰到一次專案啟動半天沒反應,也不報錯,專案在其它電腦上能正常啟動執行。日誌中有時候會報資料庫連線超時,有時候會報類似於接連池問題。

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.

Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

Caused by: java.net.ConnectException: Connection timed out: connect

 

最終問大神找到原因,是系統沒有開啟telnet.   然而我其它電腦也沒有開這個功能也照樣執行。不知道什麼造成這樣的結果 

 

telnet

       搭建或配置網路環境時,經常會使用ping命令檢查網路是否可達。有些時候Ping命令也不好使,比如因防火牆禁止或訪問策略限制等。則可使用telnet測試對映埠或遠端訪問主機。

     Telnet協議是TCP/IP協議族的其中之一,是Internet遠端登入服務的標準協議和主要方式,常用於網頁伺服器的遠端控制,可供使用者在本地主機執行遠端主機上的工作。

啟用telnet

       操作過程:點選"開始"→"控制器面板"→" 檢視方式:型別"則點選"程式"("檢視方式:大圖示"則點選"程式和功能")→ "啟動或關閉windows功能"→ 在"Windows功能"介面勾選Telnet伺服器