0
votes

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)

4

4 Answers

12
votes

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.

1
votes

I assume that you are running the project from the newest version of IntelliJ, 2017.2. The workaround is to disable "Enable JMX Agent" in the run configuration for the boot project.

I opened an issue for this at https://github.com/BroadleafCommerce/Issues/issues/1, this should be resolved in the next version of Broadleaf.

0
votes

Try using @Qualifier annotation with the bean id you are trying to load,

@Qualifier("{bean_id_here}")

0
votes

Annotate either

  1. exporter
  2. blAutoDDLStatusExporter
  3. hibernateExporter

with primary="true" in your xml config files to let Spring know when bean should be the default for the Spring Admin JMX config or disable Spring Admin JMX auto-configuration by setting the spring.application.admin=false in your application.properties.