While deploying more than one Spring Boot application in a single Tomcat server means showing exception. How to solve this?

前端 未结 3 846
孤街浪徒
孤街浪徒 2021-01-04 07:48

I am using Spring Boot in my Java application, and to deployment used Tomcat 7. I was trying to deploy multiple Spring Boot projects in the same server it showing exceptions

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-04 08:43

    I think what happens when you deploy multiple Spring Boot applications is those apps try to register to jmx on the same jvm using the same name.

    1. Check this issue for the solution https://github.com/spring-cloud/spring-cloud-config/issues/118

    2. Copy-paste from DavidBiesack's solution (regarding application.properties or application.yaml)

    I was able to solve this by defining the following in my application.properties

    spring.application.name=my-app-name
    spring.jmx.default-domain=my-app-name
    

    Or for application.yaml:

    spring:
      application:
        name: my-app-name
      jmx:
        default-domain: my-app-name
    

提交回复
热议问题