Search code examples
javaspringspring-bootbroadleaf-commerce

Constructor in org.springframework.boot.autoconfigure.admin.SpringApplicationAdminJmxAutoConfiguration required a single bean, but 3 were found


I have an issue with running demo site (or admin) after configuring demo using this link

I got this error

*************************** APPLICATION FAILED TO START


Description:

Constructor in org.springframework.boot.autoconfigure.admin.SpringApplicationAdminJmxAutoConfiguration required a single bean, but 3 were found: - exporter: defined in class path resource [bl-common-applicationContext-mbeans.xml] - blAutoDDLStatusExporter: defined in class path resource [bl-common-applicationContext-mbeans.xml] - hibernateExporter: defined in class path resource [bl-common-applicationContext-mbeans.xml]

Action:

Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed

How can I solve issue this issue?

Please note that I am using the latest Broadleaf Commerce version (5.2)


Solution

  • thanks for the answers, I managed to get it to run by removing the JMX property in the configuration properties from within IntelliJ.

    1. click on Edit Configuration (from Run Menu)
    2. deactivate the'Enable JMX Agent' (bottom right of dialog.
    3. Apply and run

    Hope this helps.