NutzCN Logo
问答 spring boot 使用druid,一段时间后报错!!!
发布于 2629天前 作者 pontali 1957 次浏览 复制 上一个帖子 下一个帖子
标签:

刚开始没问题,一段时间后报错,麻烦各位帮忙看看什么问题!!!!

5 回复

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_121]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_121]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_121]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_121]
at com.mysql.jdbc.Util.handleNewInstance(Util.java:425) ~[mysql-connector-java-5.1.43.jar:5.1.43]
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:989) ~[mysql-connector-java-5.1.43.jar:5.1.43]
at com.mysql.jdbc.MysqlIO.(MysqlIO.java:341) ~[mysql-connector-java-5.1.43.jar:5.1.43]
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2196) ~[mysql-connector-java-5.1.43.jar:5.1.43]
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2229) ~[mysql-connector-java-5.1.43.jar:5.1.43]
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2024) ~[mysql-connector-java-5.1.43.jar:5.1.43]
at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:779) ~[mysql-connector-java-5.1.43.jar:5.1.43]
at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:47) ~[mysql-connector-java-5.1.43.jar:5.1.43]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_121]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_121]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_121]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_121]
at com.mysql.jdbc.Util.handleNewInstance(Util.java:425) ~[mysql-connector-java-5.1.43.jar:5.1.43]
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:389) ~[mysql-connector-java-5.1.43.jar:5.1.43]
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330) ~[mysql-connector-java-5.1.43.jar:5.1.43]
at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:149) ~[druid-1.1.2.jar:1.1.2]
at com.alibaba.druid.filter.FilterAdapter.connection_connect(FilterAdapter.java:786) ~[druid-1.1.2.jar:1.1.2]
at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:143) ~[druid-1.1.2.jar:1.1.2]
at com.alibaba.druid.filter.stat.StatFilter.connection_connect(StatFilter.java:217) ~[druid-1.1.2.jar:1.1.2]
at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:143) ~[druid-1.1.2.jar:1.1.2]
at com.alibaba.druid.filter.FilterAdapter.connection_connect(FilterAdapter.java:786) ~[druid-1.1.2.jar:1.1.2]
at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:143) ~[druid-1.1.2.jar:1.1.2]
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1466) ~[druid-1.1.2.jar:1.1.2]
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1529) ~[druid-1.1.2.jar:1.1.2]
at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2185) ~[druid-1.1.2.jar:1.1.2]
Caused by: java.net.NoRouteToHostException: Can't assign requested address (Address not available)
at java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:1.8.0_121]
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[na:1.8.0_121]
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[na:1.8.0_121]
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[na:1.8.0_121]
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:1.8.0_121]
at java.net.Socket.connect(Socket.java:589) ~[na:1.8.0_121]
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:211) ~[mysql-connector-java-5.1.43.jar:5.1.43]
at com.mysql.jdbc.MysqlIO.(MysqlIO.java:300) ~[mysql-connector-java-5.1.43.jar:5.1.43]
... 22 common frames omitted


server: port: 8801 #log logging: level: cn: nutz: debug sayyoo: debug org: springframework: transaction: debug web: debug #nutz dao nutz: json: date-format: yyyy-MM-dd HH:mm:ss z dao: runtime: add-column: true check-index: true delete-column: true foce-create: false #此配置为true则每次均会删表重建 create: true migration: true basepackage: cn.sayyoo sqlmanager: paths: - sqls #spring spring: datasource: druid: url: jdbc:mysql://127.0.0.1:3306/example?useUnicode=true&characterEncoding=UTF-8&useSSL=false username: root password: root driver-class-name: com.mysql.jdbc.Driver filter: config: enabled: true filters: stat,wall initial-size: 5 max-active: 20 max-wait: 60000 min-evictable-idle-time-millis: 300000 min-idle: 5 stat-view-servlet: enabled: true loginPassword: admin loginUsername: admin resetEnable: false urlPattern: /druid/* test-on-borrow: false test-on-return: false test-while-idle: true time-between-eviction-runs-millis: 60000 validation-query: SELECT 'x' validation-query-timeout: 60000 web-stat-filter: enabled: true exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*' principalCookieName: xxx.user principalSessionName: xxx.user profile-enable: false session-stat-enable: false session-stat-max-count: 1000 url-pattern: /* output: ansi: enabled: always application: name: microservice-support-workflow #swagger swagger2: api-info: # API信息 title: example # API标题 description: spring boot example # API描述 license: ponta # 许可证 license-url: https://opensource.org/licenses/MIT # 许可证URl terms-of-service-url: http://www.swagger.io # 服务条款URL version: 1.0 # API版本 contact: # 联系人信息 email: 476828588@qq.com # 联系人邮箱 name: ponta # 联系人姓名 url: http://www.sayyoo.cn # 联系人URL base-package: cn.sayyoo # swagger解析包路径 base-path: /** # swagger解析URL规则(ANT规则) exclude-path: /error/** # swagger排除解析URL规则(ANT规则) global-operation-parameter: # 全局参数配置,比如token 放在header中 - name: token # 参数名称 description: access token # 参数说明 required: true # 是否必须 model-ref: string # 参数数据类型 paramType: header # 参数类型,可选 query, path, body, header, 详细查看swagger文档 eureka: client: # 客户端进行Eureka注册的配置 service-url: defaultZone: http://localhost:8888/eureka instance: lease-renewal-interval-in-seconds: 2 # 设置心跳的时间间隔(默认是30秒) lease-expiration-duration-in-seconds: 5 # 如果现在超过了5秒的间隔(默认是90秒) instance-id: microservice-example-service1 # 在信息列表时显示主机名称 prefer-ip-address: true # 访问的路径变为IP地址

一般是多久?

不久,几分钟吧,不超过一个小时

机器性能不行吧...

validation-query-timeout: 60000 // 这也太长了吧
添加回复
请先登陆
回到顶部