我已经创建了用于尝试多个上下文的基本Spring启动应用程序,这里是源代码here
该应用程序的结构是:
在我添加" webapp"应用程序上下文,它给出了以下错误
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springApplicationAdminRegistrar' defined in class path resource [org/springframework/boot/autoconfigure/admin/SpringApplicationAdminJmxAutoConfiguration.class]: Invocation of init method failed; nested exception is javax.management.InstanceAlreadyExistsException: org.springframework.boot:type=Admin,name=MultiContextApplication
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1706) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:579) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:501) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE]
Where" MultiContextApplication"是application.properties文件中提供的应用程序jmx-name
spring.application.admin.jmx-name=org.springframework.boot:type=Admin,name=MultiContextApplication
Main.java是带有@SpringConfiguration注释的主类。
任何人都可以让我知道可能是什么问题,
谢谢&问候, 程序员