Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

unable to see JMX configuration in JXM console in AEM 6.4

Avatar

Level 3

Hi All,

I'm having the below JMX java class with the implementation. Once I build this and deploy it into bundles, in the logs I could see the particular JMX Service is registered successfully. But the particular service is not available in JMX console. The same service which I want to see is available in AEM 6.1 JMX console. Right now I'm working in 6.4 upgrade.In this server I'm unable to see.. any ideas?? Appreciate your help.

package ch.sample.aem.core.jmx;

import com.adobe.granite.jmx.annotation.Description;

@Description("Hybris related MBean to manually start the import")

public interface HybrisImporterMBean {

  // Incremental update does not really work on Hybris, only if the product itself is changed but

  // not if depending data like categories are changed

  // @Description("Initiates a new hybris import")

  // boolean startImport(@Name("clearProducts") @Description("Re-initializes the complete product

  // repository") boolean clear);

  @Description("Initiates a new hybris import")

  boolean startImport();

}

===================================

package ch.sample.aem.core.jmx;

import ch.sample.aem.core.commerce.hybris.importer.sampleHybrisImporterJob;

import com.adobe.granite.jmx.annotation.AnnotatedStandardMBean;

import javax.management.DynamicMBean;

import javax.management.NotCompliantMBeanException;

import org.osgi.service.component.annotations.Component;

import org.osgi.service.component.annotations.Reference;

import org.slf4j.Logger;

import org.slf4j.LoggerFactory;

@Component(immediate = true,service = DynamicMBean.class,property =  {"name =" + "jmx.objectname",

    "value =" + "ch.sample.aem:type=Hybris Importer"})

public class HybrisImporterMBeanImpl extends AnnotatedStandardMBean implements HybrisImporterMBean {

  private static final Logger LOG = LoggerFactory.getLogger(HybrisImporterMBeanImpl.class);

  private sampleHybrisImporterJob sampleHybrisImporterJob;

 

  @Reference

  public void bindsampleHybrisImporterJob(sampleHybrisImporterJob sampleHybrisImporterJob) {

    this.sampleHybrisImporterJob = sampleHybrisImporterJob;

  }

  public void unbindsampleHybrisImporterJob(sampleHybrisImporterJob sampleHybrisImporterJob) {

    this.sampleHybrisImporterJob = sampleHybrisImporterJob;

  }

  public HybrisImporterMBeanImpl() throws NotCompliantMBeanException {

    super(HybrisImporterMBean.class);

  }

  @Override

  public boolean startImport() {

    LOG.info("Start Hybris import job via JMX");

    sampleHybrisImporterJob.executeImport();

    LOG.info("Hybris import job has been executed via JMX");

    return true;

  }

}

Logs:

*INFO* [FelixStartLevel] ch.sample.aem.core-bundle Service [ch.sample.aem.core.jmx.HybrisImporterMBeanImpl,7690, [javax.management.DynamicMBean]] ServiceEvent REGISTERED

Additionally..I'm getting Service Unregistered issue for most of the service. like below,

*INFO* [Thread-1665] com.adobe.granite.startup Service [40, [org.osgi.service.event.EventHandler]] ServiceEvent UNREGISTERING

*INFO* [FelixStartLevel] com.adobe.granite.repository Service [859, [org.apache.jackrabbit.oak.plugins.index.counter.jmx.NodeCounterMBean]] ServiceEvent UNREGISTERING

Thanks,

Vijay

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Please check Anatomy of the Ideal Background Job | Perficient Digital

I tried above and registering mean is working for me.



Arun Patidar

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Please check Anatomy of the Ideal Background Job | Perficient Digital

I tried above and registering mean is working for me.



Arun Patidar