Code example for MalformedObjectNameException

Methods: getMessage

0
    ObjectName mbeanName = null;
 
    try { 
      mbeanName = new ObjectName(objectName);
    } catch (final MalformedObjectNameException e) {
      LOG.error("Error creating MBean ObjectName: " + objectName + ", " + e.getMessage());
    } catch (final NullPointerException e) {
      LOG.error("Error creating MBean ObjectName: " + objectName + ", " + e.getMessage());
    } 
 
    try { 
      mbeanServer.registerMBean(object, mbeanName);
    } catch (final InstanceAlreadyExistsException e) {
      LOG.error("Error registering MBean: " + objectName + ", " + e.getMessage());
    } catch (final MBeanRegistrationException e) {
      LOG.error("Error registering MBean: " + objectName + ", " + e.getMessage());
    } catch (final NotCompliantMBeanException e) {
      LOG.error("Error registering MBean: " + objectName + ", " + e.getMessage());
    }