zwx900102
双子孤狼
2016-04-21 04:02

hikari数据库连接池问题

  • 数据库连接池

spring:
http:
encoding.charset: UTF-8
encoding.enable: true
encoding.force: true
datasource:
name: hikari
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://localhost:3306/test
username: root
password: 123456

    # hikari
    type: com.zaxxer.hikari.HikariDataSource
    maximum-pool-size: 100
    max-idle: 10
    max-wait: 10000
    min-idle: 5
    initial-size: 5
    validation-query: SELECT 1
    test-on-borrow: false
    test-while-idle: true
    time-between-eviction-runs-millis: 18800

第一次启动成功了,没报错,项目也能正常访问了,可是后面更新了项目重新启动之后就一直报错:
org.springframework.jmx.export.UnableToRegisterMBeanException: Unable to register MBean [HikariDataSource (HikariPool-0)] with key 'dataSource'; nested exception is javax.management.InstanceAlreadyExistsException: com.zaxxer.hikari:name=dataSource,type=HikariDataSource

这是说实例已经存在了吗,这个问题要怎么解决呢
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答

为你推荐