logger.info("{} Instance Not Found in Platform MBean Server", objectName); if (logger.isDebugEnabled()) { logger.debug(e.getMessage(), e);
private static void internalRegister(Object obj, MBeanServer server, String name) throws MalformedObjectNameException, MBeanRegistrationException { if (obj == null) throw new IllegalArgumentException("Object being registered cannot be null"); if (server == null) throw new IllegalArgumentException("MBean server used for registeration cannot be null"); try { ObjectName objName = getObjectName(obj, name); if(server.isRegistered(objName)) { log.warn("unregistering already registered MBean: " + objName); try { server.unregisterMBean(objName); } catch(InstanceNotFoundException e) { log.error(Util.getMessage("FailedToUnregisterMBean") + e.getMessage()); } } ResourceDMBean res=new ResourceDMBean(obj); server.registerMBean(res, objName); } catch (InstanceAlreadyExistsException e) { throw new MBeanRegistrationException(e, "The @MBean objectName is not unique"); } catch (NotCompliantMBeanException e) { throw new MBeanRegistrationException(e); } }
/** * Add a proxy to the map to be used by bridge. * * @param objectName object name of the proxy * @param proxy actual proxy instance */ public void addMemberToSystem(ObjectName objectName, MemberMXBean proxy, FederationComponent newState) { if (objectName.equals(thisMemberName)) { ObjectName distrObjectName = MBeanJMXAdapter.getDistributedSystemName(); DistributedSystemMXBean systemMBean = new DistributedSystemMBean(this); service.registerInternalMBean(systemMBean, distrObjectName); this.systemLevelNotifEmitter = (DistributedSystemMBean) service.getDistributedSystemMXBean(); this.distListener = new DistributedSystemNotifListener(); } if (mapOfMembers != null) { mapOfMembers.put(objectName, proxy); memberSetSize = mapOfMembers.values().size(); } updateMember(objectName, newState, null); try { mbeanServer.addNotificationListener(objectName, distListener, null, null); } catch (InstanceNotFoundException e) { if (logger.isDebugEnabled()) { logger.debug(e.getMessage()); } logger.info("{} Instance Not Found in Platform MBean Server", objectName); } }
logger.warn(e.getMessage(), e); } catch (InstanceNotFoundException e) { logger.warn(e.getMessage(), e); } catch (ReflectionException e) { logger.warn(e.getMessage(), e);
throw ie; } catch (InstanceNotFoundException e) { InternalError ie = new InternalError(e.getMessage()); ie.initCause(e); throw ie;
private static MBeanInfo getMBeanInfoAcrossAll(ObjectName name, List<MBeanServer> mbeanServers) throws Exception { InstanceNotFoundException firstException = null; for (MBeanServer mbeanServer : mbeanServers) { try { return mbeanServer.getMBeanInfo(name); } catch (InstanceNotFoundException e) { logger.debug(e.getMessage(), e); if (firstException == null) { firstException = e; } } } throw checkNotNull(firstException); }
private static Object getAttributeAcrossAll(ObjectName name, String attribute, List<MBeanServer> mbeanServers) throws Exception { InstanceNotFoundException firstException = null; for (MBeanServer mbeanServer : mbeanServers) { try { return mbeanServer.getAttribute(name, attribute); } catch (InstanceNotFoundException e) { logger.debug(e.getMessage(), e); if (firstException == null) { firstException = e; } } } throw checkNotNull(firstException); }
/** * Add an exception which occurred during extraction of an {@link MBeanInfo} for * a certain {@link ObjectName} to this map. * * @param pName MBean name for which the error occurred * @param pExp exception occurred * @throws IllegalStateException if this method decides to rethrow the exception */ public void handleException(ObjectName pName, InstanceNotFoundException pExp) throws InstanceNotFoundException { // This happen happens for JBoss 7.1 in some cases (i.e. ResourceAdapterModule) if (pathStack.size() == 0) { addException(pName, pExp); } else { throw new InstanceNotFoundException("InstanceNotFoundException for MBean " + pName + " (" + pExp.getMessage() + ")"); } }
logger.debug(e.getMessage(), e);
private void unregisterServices() { try { if (this.servicesObjectName != null) mbs.unregisterMBean(this.servicesObjectName); } catch (InstanceNotFoundException e) { LOGGER.trace("Failed to unregister services" + e.getMessage()); } catch (MBeanRegistrationException e) { LOGGER.trace("Failed to unregister services" + e.getMessage()); } }
private void unregisterComponentInfo() { try { if (this.connetctionsObjectName != null) mbs.unregisterMBean(this.componentInfoObjectName); } catch (InstanceNotFoundException e) { LOGGER.trace("Failed to unregister ComponentInfo" + e.getMessage()); } catch (MBeanRegistrationException e) { LOGGER.trace("Failed to unregister ComponentInfo" + e.getMessage()); } }
private void unregisterConnetctions() { try { if (this.connetctionsObjectName != null) mbs.unregisterMBean(this.connetctionsObjectName); } catch (InstanceNotFoundException e) { LOGGER.trace("Failed to unregister server connetctions" + e.getMessage()); } catch (MBeanRegistrationException e) { LOGGER.trace("Failed to unregister server connetctions" + e.getMessage()); } }
private void unregisterBean(ObjectName name) { try { server.unregisterMBean(name); } catch (InstanceNotFoundException e) { // This is often thrown when the process is shutting down. An application with lots of // metrics will often begin unregistering metrics *after* JMX itself has cleared, // resulting in a huge dump of exceptions as the process is exiting. log.trace("Error unregistering '" + name + "': " + e.getMessage(), e); } catch (MBeanRegistrationException e) { log.trace("Error unregistering '" + name + "': " + e.getMessage(), e); } } }
@Override void executeStrategy(Map<String, AttributeConfigElement> configuration, ConfigTransactionClient ta, ObjectName on, ServiceRegistryWrapper services) throws NetconfConfigHandlingException { try { ta.destroyModule(on); LOG.debug("ServiceInstance {} deleted successfully", on); } catch (InstanceNotFoundException e) { throw new NetconfConfigHandlingException( String.format("Unable to delete %s because of exception %s" + on, e.getMessage()), NetconfDocumentedException.ErrorType.application, NetconfDocumentedException.ErrorTag.operation_failed, NetconfDocumentedException.ErrorSeverity.error); } } }
/** * @deprecated Use {@link #unexportObject(Object)} after exporting with {@link #export(Object, boolean, String, Map)} */ @Deprecated public void unexport(ObjectName objectName) { try { registry.unregisterLegacy(objectName); } catch (InstanceNotFoundException e) { throw new ReportException(Reason.INSTANCE_NOT_FOUND, e.getMessage()); } } }
/** * Add an exception which occurred during extraction of an {@link MBeanInfo} for * a certain {@link ObjectName} to this map. * * @param pName MBean name for which the error occurred * @param pExp exception occurred * @throws IllegalStateException if this method decides to rethrow the exception */ public void handleException(ObjectName pName, InstanceNotFoundException pExp) throws InstanceNotFoundException { // This happen happens for JBoss 7.1 in some cases (i.e. ResourceAdapterModule) if (pathStack.size() == 0) { addException(pName, pExp); } else { throw new InstanceNotFoundException("InstanceNotFoundException for MBean " + pName + " (" + pExp.getMessage() + ")"); } }
/** * Add an exception which occurred during extraction of an {@link MBeanInfo} for * a certain {@link ObjectName} to this map. * * @param pName MBean name for which the error occurred * @param pExp exception occurred * @throws IllegalStateException if this method decides to rethrow the exception */ public void handleException(ObjectName pName, InstanceNotFoundException pExp) throws InstanceNotFoundException { // This happen happens for JBoss 7.1 in some cases (i.e. ResourceAdapterModule) if (pathStack.size() == 0) { addException(pName, pExp); } else { throw new InstanceNotFoundException("InstanceNotFoundException for MBean " + pName + " (" + pExp.getMessage() + ")"); } }
/** * Undo the export of an object to the metrics reporting system. * * @param object The object to unexport */ public void unexportObject(Object object) { try { registry.unregister(object); } catch (InstanceNotFoundException e) { throw new ReportException(Reason.INSTANCE_NOT_FOUND, e.getMessage()); } }
public void unexport(ObjectName objectName) { try { synchronized(exportedObjects) { server.unregisterMBean(objectName); exportedObjects.remove(objectName); } } catch (MBeanRegistrationException e) { throw new JmxException(Reason.MBEAN_REGISTRATION, e.getMessage(), e.getCause()); } catch (InstanceNotFoundException e) { throw new JmxException(Reason.INSTANCE_NOT_FOUND, e.getMessage()); } }
public void unexport(ObjectName objectName) { try { synchronized(exportedObjects) { server.unregisterMBean(objectName); exportedObjects.remove(objectName); } } catch (MBeanRegistrationException e) { throw new JmxException(Reason.MBEAN_REGISTRATION, e.getMessage(), e.getCause()); } catch (InstanceNotFoundException e) { throw new JmxException(Reason.INSTANCE_NOT_FOUND, e.getMessage()); } }