tomcat 啟動應用報錯:java.sql.SQLException: Io 異常: Connection reset
客戶給了幾臺虛擬機器,要求先安裝一臺tomcat部署個測試環境。既然是測試環境,就只需簡單安裝 jdk 和 tomcat,啟動tomcat能正常啟動。
然後,把專案war包扔到tomcat的webapps目錄下,再次啟動後,開始載入專案,不過馬上就開始報錯:
java.sql.SQLException: Io 異常: Connection reset
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:222)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:335)
at oracle.jdbc.driver.OracleConnection.(OracleConnection.java:361)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:442)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:321)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:68)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:87)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1.acquireResource(C3P0PooledConnectionPool.java:83)
at com.mchange.v2.resourcepool.BasicResourcePool.assimilateResource(BasicResourcePool.java:884)
at com.mchange.v2.resourcepool.BasicResourcePool.acquireUntil(BasicResourcePool.java:601)
at com.mchange.v2.resourcepool.BasicResourcePool.access$400(BasicResourcePool.java:31)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1079)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:354)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:222)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:335)
at oracle.jdbc.driver.OracleConnection.
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:442)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:321)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:68)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:87)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1.acquireResource(C3P0PooledConnectionPool.java:83)
at com.mchange.v2.resourcepool.BasicResourcePool.assimilateResource(BasicResourcePool.java:884)
at com.mchange.v2.resourcepool.BasicResourcePool.acquireUntil(BasicResourcePool.java:601)
at com.mchange.v2.resourcepool.BasicResourcePool.access$400(BasicResourcePool.java:31)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1079)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:354)
遇到這種報錯,首先想得的是資料庫連線是不是配置錯誤,防火牆是不是關閉等等。。。一一檢查,都沒發現問題。
後來,無意識看了一下hosts檔案,發現內容如下:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 panda1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
感覺這裡設定有點問題,按自己思路設定一下,然後重啟機器。再次啟動tomcat,則能正常啟動專案,不再報錯。
# that require network functionality will fail.
127.0.0.1 panda1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
感覺這裡設定有點問題,按自己思路設定一下,然後重啟機器。再次啟動tomcat,則能正常啟動專案,不再報錯。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9399028/viewspace-743345/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- tomcat連線池不夠-java.sql.SQLException: Io 異常: Connection resetTomcatJavaSQLException
- java.sql.SQLException: Io 異常: Connection refusedJavaSQLException
- maven外掛 tomcat7啟動報錯,異常如下MavenTomcat
- HttpClient遭遇Connection Reset異常,如何正確配置?HTTPclient
- Sqoop從Oracle抽數錯:IO Error: Connection resetOOPOracleError
- Java中處理SocketException: Connection reset”異常的方法JavaException
- java.io.IOException: Connection reset by peerJavaException
- Linux啟動tomcat後執行shutdown.sh關閉時出現異常:Connection refused (Connection refused)LinuxTomcat
- java.sql.SQLException: Io 異常: The Network Adapter could not establish the connecJavaSQLExceptionAPT
- JMETER java.net.SocketException: Connection reset 報錯解決方案JMeterJavaException
- oracle出異常:Io 異常: The Network Adapter could not establish the connection 解決辦法OracleAPT
- 解決tomcat啟動時無法找到GroovyObject 異常TomcatObject
- 連線華為雲的Redis服務報錯“Error: Connection reset by peer”RedisError
- tomcat埠被佔用異常Tomcat
- tomcat5啟動NotSerializableException報錯解決TomcatException
- Tomcat啟動時無法找到配置檔案異常(eclipse)TomcatEclipse
- 攔截線上 sql 異常報錯SQL
- 使用laravel/passport 4.0異常報錯LaravelPassport
- java.sql.SQLException: No value specified for parameter 1 異常分析JavaSQLException
- 使用 sentry 除錯應用和監控異常除錯
- 解決devenv.exe應用程式錯誤,應用程式發生異常dev
- Tomcat啟動報錯:Error starting static Resources解決方法TomcatError
- java.sql.SQLException:IO 錯誤:Socket read timed out !JavaSQLException
- 前端JavaScript 常見的報錯及異常捕獲前端JavaScript
- JAVA: 捕捉啟動時的異常Java
- Connection reset by peer: socket write errorError
- tomcat伺服器經常報錯PermGen SpaceTomcat伺服器
- mongodb 啟動報錯MongoDB
- php啟動報錯PHP
- java.net.ConnectException: Connection refused 異常JavaException
- tomcat啟動超時以及啟動之後開啟網頁報404錯誤的解決方法Tomcat網頁
- React Native Android 啟動異常React NativeAndroid
- python應用:異常處理Python
- 處理mysql無法啟動且啟動時服務沒報錯的異常情況MySql
- Kubelet 錯誤日誌 broken pipe 和 connection reset by peer 的原因分析
- 錯誤 101 (net::ERR_CONNECTION_RESET):連線已重置
- No Bean named 'Xxx' available 異常報錯BeanAI
- javascript異常報錯型別簡單介紹JavaScript型別