首页新闻找找看学习计划

第一次访问正常,第二次访问就报错,哪里的问题

0
悬赏园豆:10 [已解决问题] 解决于 2019-03-01 15:26

2019-03-01 14:06:44.201 INFO 704 --- [nio-8080-exec-4] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2019-03-01 14:06:44.508 INFO 704 --- [nio-8080-exec-4] com.zaxxer.hikari.pool.PoolBase : HikariPool-1 - Driver does not support get/set network timeout for connections. (com.informix.jdbc.IfxSqliConnect.getNetworkTimeout()I)
2019-03-01 14:06:45.005 INFO 704 --- [nio-8080-exec-4] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2019-03-01 14:06:45.023 DEBUG 704 --- [nio-8080-exec-4] c.c.d.r.I.selectImportCountList : ==> Preparing: select first 100 date(import_time) as import_time,count(*) as counts from import_backup group by 1 order by date(import_time) desc;
2019-03-01 14:06:45.064 DEBUG 704 --- [nio-8080-exec-4] c.c.d.r.I.selectImportCountList : ==> Parameters:
2019-03-01 14:06:45.538 DEBUG 704 --- [nio-8080-exec-4] c.c.d.r.I.selectImportCountList : <== Total: 100
2019-03-01 14:07:51.018 ERROR 704 --- [nio-8080-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:

Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLTransientConnectionException: HikariPool-1 - Connection is not available, request timed out after 62487ms.

The error may exist in com/czhs/datafx/repository/ImportCountMapper.xml

The error may involve com.czhs.datafx.repository.ImportCountMapper.selectImportCountList

The error occurred while executing a query

Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLTransientConnectionException: HikariPool-1 - Connection is not available, request timed out after 62487ms.] with root cause

java.sql.SQLTransientConnectionException: HikariPool-1 - Connection is not available, request timed out after 62487ms.
at com.zaxxer.hikari.pool.HikariPool.createTimeoutException(HikariPool.java:676) ~[HikariCP-3.2.0.jar!/:na]
at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:190) ~[HikariCP-3.2.0.jar!/:na]
at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:155) ~[HikariCP-3.2.0.jar!/:na]
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:128) ~[HikariCP-3.2.0.jar!/:na]
at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:157) ~[spring-jdbc-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115) ~[spring-jdbc-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:78) ~[spring-jdbc-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:82) ~[mybatis-spring-2.0.0.jar!/:2.0.0]
at org.mybatis.spring.transaction.SpringManagedTransaction.getConnection(SpringManagedTransaction.java:68) ~[mybatis-spring-2.0.0.jar!/:2.0.0]
at org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:336) ~[mybatis-3.5.0.jar!/:3.5.0]
at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:85) ~[mybatis-3.5.0.jar!/:3.5.0]
at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:62) ~[mybatis-3.5.0.jar!/:3.5.0]
at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324) ~[mybatis-3.5.0.jar!/:3.5.0]
at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) ~[mybatis-3.5.0.jar!/:3.5.0]
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) ~[mybatis-3.5.0.jar!/:3.5.0]
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83) ~[mybatis-3.5.0.jar!/:3.5.0]
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148) ~[mybatis-3.5.0.jar!/:3.5.0]
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141) ~[mybatis-3.5.0.jar!/:3.5.0]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_191]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_191]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_191]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_191]

问题补充:

问题解决了,换了数据连接jar包就可以了

gslzydwgh的主页 gslzydwgh | 初学一级 | 园豆:194
提问于:2019-03-01 14:33
< >
分享
最佳答案
0

修改数据库连接jar包即可解决该问题。

gslzydwgh | 初学一级 |园豆:194 | 2019-03-01 15:24
其他回答(2)
0

连接超时,可能是数据库没启动吧

收获园豆:10
会长 | 园豆:6743 (大侠五级) | 2019-03-01 14:40

数据库是正常的,第一次能正常查出数据,刷新再查就出这个问题

支持(0) 反对(0) gslzydwgh | 园豆:194 (初学一级) | 2019-03-01 14:57
0

请问如何修改哈

馒头的梦想 | 园豆:204 (菜鸟二级) | 2020-04-28 13:41
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册