解决异常:“Thelastpacketsentsuccessfullytotheserve。。。
今天写ssm的时候遇见⼀个错误,
我的报错如下
1警告: sourcepool.BasicResourcePool$ScatteredAcquireTask@21ee9275 -- Acquisition Attempt Failed Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maxim  ptions.jdbc4.CommunicationsException: Communications link failure
3
4 The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
5    wInstance(Unknown Source)
6    wInstance(DelegatingConstructorAccessorImpl.java:45)
7    at wInstance(Constructor.java:423)
8    sql.jdbc.Util.handleNewInstance(Util.java:425)
9    sql.ateCommunicationsException(SQLError.java:990)
10    sql.jdbc.MysqlIO.<init>(MysqlIO.java:342)
11    sql.Connect(ConnectionImpl.java:2197)
12    sql.tOneTryOnly(ConnectionImpl.java:2230)
13    sql.ateNewIO(ConnectionImpl.java:2025)
14    sql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:778)
15    sql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
16    wInstance(Unknown Source)
17    wInstance(DelegatingConstructorAccessorImpl.java:45)
18    at wInstance(Constructor.java:423)
19    sql.jdbc.Util.handleNewInstance(Util.java:425)
20    sql.Instance(ConnectionImpl.java:386)
21    sql.t(NonRegisteringDriver.java:330)
22    hange.v2.Connection(DriverManagerDataSource.java:175)
23    hange.v2.PooledConnection(WrapperConnectionPoolDataSource.java:220)
24    hange.v2.PooledConnection(WrapperConnectionPoolDataSource.java:206)
25    hange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:203)
26    sourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1138)
27    sourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1125)
28    sourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44)
29    sourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1870)
30    hange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696)
31 Caused by: java.ConnectException: Connection refused: connect
32    at t0(Native Method)
33    at java.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
34    at java.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
35    at tToAddress(AbstractPlainSocketImpl.java:206)
36    at t(AbstractPlainSocketImpl.java:188)
37    at t(PlainSocketImpl.java:172)
38    at t(SocksSocketImpl.java:392)
39    at t(Socket.java:589)
40    sql.t(StandardSocketFactory.java:211)
41    sql.jdbc.MysqlIO.<init>(MysqlIO.java:301)
42    ... 20 more
43
44⼋⽉ 21, 2020 5:01:26 下午 sourcepool.BasicResourcePool
45警告: Having failed to acquire a resource, sourcepool.BasicResourcePool@52
0d0d4e is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests.
46⼋⽉ 21, 2020 5:01:26 下午 sourcepool.BasicResourcePool
47警告: sourcepool.BasicResourcePool$ScatteredAcquireTask@634f6fcf -- Acquisition Attempt Failed Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximu  ptions.jdbc4.CommunicationsException: Communications link failure
49
50 The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
51    wInstance(Unknown Source)
52    wInstance(DelegatingConstructorAccessorImpl.java:45)pending
53    at wInstance(Constructor.java:423)
54    sql.jdbc.Util.handleNewInstance(Util.java:425)
55    sql.ateCommunicationsException(SQLError.java:990)
56    sql.jdbc.MysqlIO.<init>(MysqlIO.java:342)
57    sql.Connect(ConnectionImpl.java:2197)
58    sql.tOneTryOnly(ConnectionImpl.java:2230)
59    sql.ateNewIO(ConnectionImpl.java:2025)
60    sql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:778)
61    sql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
62    wInstance(Unknown Source)
63    wInstance(DelegatingConstructorAccessorImpl.java:45)
64    at wInstance(Constructor.java:423)
65    sql.jdbc.Util.handleNewInstance(Util.java:425)
66    sql.Instance(ConnectionImpl.java:386)
67    sql.t(NonRegisteringDriver.java:330)
68    hange.v2.Connection(DriverManagerDataSource.java:175)
69    hange.v2.PooledConnection(WrapperConnectionPoolDataSource.java:220)
70    hange.v2.PooledConnection(WrapperConnectionPoolDataSource.java:206)
71    hange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:203)
72    sourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1138)
73    sourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1125)
74    sourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44)
75    sourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1870)
76    hange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696)
77 Caused by: java.ConnectException: Connection refused: connect
78    at t0(Native Method)
79    at java.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
80    at java.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
81    at tToAddress(AbstractPlainSocketImpl.java:206)
82    at t(AbstractPlainSocketImpl.java:188)
83    at t(PlainSocketImpl.java:172)
84    at t(SocksSocketImpl.java:392)
85    at t(Socket.java:589)
86    sql.t(StandardSocketFactory.java:211)
87    sql.jdbc.MysqlIO.<init>(MysqlIO.java:301)
88    ... 20 more
89
90⼋⽉ 21, 2020 5:01:26 下午 sourcepool.BasicResourcePool
91警告: sourcepool.BasicResourcePool$ScatteredAcquireTask@6c971fde -- Acquisition Attempt Failed Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maxim  ptions.jdbc4.Communi
cationsException: Communications link failure
93
94 The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
95    wInstance(Unknown Source)
96    wInstance(DelegatingConstructorAccessorImpl.java:45)
97    at wInstance(Constructor.java:423)
98    sql.jdbc.Util.handleNewInstance(Util.java:425)
99    sql.ateCommunicationsException(SQLError.java:990)
100    sql.jdbc.MysqlIO.<init>(MysqlIO.java:342)
101    sql.Connect(ConnectionImpl.java:2197)
102    sql.tOneTryOnly(ConnectionImpl.java:2230)
103    sql.ateNewIO(ConnectionImpl.java:2025)
104    sql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:778)
105    sql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
106    wInstance(Unknown Source)
107    wInstance(DelegatingConstructorAccessorImpl.java:45)
108    at wInstance(Constructor.java:423)
109    sql.jdbc.Util.handleNewInstance(Util.java:425)
110    sql.Instance(ConnectionImpl.java:386)
111    sql.t(NonRegisteringDriver.java:330)
112    hange.v2.Connection(DriverManagerDataSource.java:175)
113    hange.v2.PooledConnection(WrapperConnectionPoolDataSource.java:220)
114    hange.v2.PooledConnection(WrapperConnectionPoolDataSource.java:206)
115    hange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:203)
116    sourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1138)
117    sourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1125)
118    sourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44)
119    sourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1870)
120    hange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696)
121 Caused by: java.ConnectException: Connection refused: connect
122    at t0(Native Method)
123    at java.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
124    at java.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
125    at tToAddress(AbstractPlainSocketImpl.java:206)
126    at t(AbstractPlainSocketImpl.java:188)
127    at t(PlainSocketImpl.java:172)
128    at t(SocksSocketImpl.java:392)
129    at t(Socket.java:589)
130    sql.t(StandardSocketFactory.java:211)
131    sql.jdbc.MysqlIO.<init>(MysqlIO.java:301)
132    ... 20 more
上⽹查了很多,
有的说是dao层xml条件参数值错误,仔细检查并没有,
有的说是⼀般有Illegal access: this web application instance has been stopped already.  Could not load+....+The eventual following stack trace is caused by+.......这种类型的错误都是因为重新加载失败引起的;
检查各种属性名和参数名都没问题之后,最后打开服务才发现是mysql服务停⽌,打开就好,其实解决之后发现,报错的提⽰中含有jdbc⼏个关键字,不难发现是连接出现错误希望能给朋友们解决问题
总结,遇到bug不要急,先排除代码问题再看配置,再康康环境,慢慢来,冰冻三尺,⾮⼀⽇之寒

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。