gpt4 book ai didi

javax.management.InstanceAlreadyExistsException : com. zaxxer.hikari :name=dataSource, 类型=HikariDataSource

转载 作者:搜寻专家 更新时间:2023-11-01 01:31:21 26 4
gpt4 key购买 nike

我该如何解决这个问题?哪个是最好的选择以及如何做到这一点

  1. 设置唯一的池名
  2. 销毁之前的连接池

error message screenshot

org.apache.catalina.core.ApplicationContext.log Initializing Spring embedded WebApplicationContext
11-Aug-2018 16:05:53.863 SEVERE [Catalina-startStop-1] org.apache.catalina.core.ContainerBase.startInternal A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[sss].StandardContext[]]
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at ..........
...............
......
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[sss].StandardContext[]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
... 6 more
Caused by: org.springframework.jmx.export.UnableToRegisterMBeanException: Unable to register MBean [HikariDataSource (HikariPool-2)] with key 'dataSource'; nested exception is javax.management.InstanceAlreadyExistsException: com.zaxxer.hikari:name=dataSource,type=HikariDataSource
at org.springframework.jmx.export.MBeanExporter.registerBeanNameOrInstance(MBeanExporter.java:625)
at
..........................

org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5245)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 6 more
Caused by: javax.management.InstanceAlreadyExistsException: com.zaxxer.hikari:name=dataSource,type=HikariDataSource
at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:437)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerWithRepository(DefaultMBeanServerInterceptor.java:1898)
at .................
............
at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)`

最佳答案

有两种方法可以解决这个问题。

我。禁用 jmx

二。设置默认域和唯一名称(如果你想启用 jmx 并拥有同一应用程序的多个实例,这是必需的)

对于禁用 jmx:

应用程序.yml:

spring:
jmx:
enabled: false

或 application.properties:

spring.jmx.enabled= false

如果需要启用 jmx,请设置以下属性。

应用程序.yml:

spring:
jmx:
default-domain: com.application.name
unique-names: true

或 application.properties:

spring.jmx.default-domain=com.application.name

关于javax.management.InstanceAlreadyExistsException : com. zaxxer.hikari :name=dataSource, 类型=HikariDataSource,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51798003/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com