public Iterable<Result> fetchResults(MBeanServerConnection mbeanServer, ObjectName queryName) throws InstanceNotFoundException, IntrospectionException, ReflectionException, IOException { ObjectInstance oi = mbeanServer.getObjectInstance(queryName); List<String> attributes; if (attr.isEmpty()) { attributes = new ArrayList<>(); MBeanInfo info = mbeanServer.getMBeanInfo(queryName); for (MBeanAttributeInfo attrInfo : info.getAttributes()) { attributes.add(attrInfo.getName()); } } else { attributes = attr; } try { if (!attributes.isEmpty()) { logger.debug("Executing queryName [{}] from query [{}]", queryName.getCanonicalName(), this); AttributeList al = mbeanServer.getAttributes(queryName, attributes.toArray(new String[attributes.size()])); return new JmxResultProcessor(this, oi, al.asList(), oi.getClassName(), queryName.getDomain()).getResults(); } } catch (UnmarshalException ue) { if ((ue.getCause() != null) && (ue.getCause() instanceof ClassNotFoundException)) { logger.debug("Bad unmarshall, continuing. This is probably ok and due to something like this: " + "http://ehcache.org/xref/net/sf/ehcache/distribution/RMICacheManagerPeerListener.html#52", ue.getMessage()); } else { throw ue; } } return ImmutableList.of(); }
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { if (in.readByte() != SERIAL_VERSION) throw new UnmarshalException("Requested version does not match local version. Please make sure you are using the same version on both ends."); healthIssueErrors = (Throwable[]) in.readObject(); }
cachePeer.send(eventMessages); } catch (UnmarshalException e) { String message = e.getMessage(); if (message.contains("Read time out") || message.contains("Read timed out")) { LOG.warn("Unable to send message to remote peer due to socket read timeout. Consider increasing" +
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { byte version = in.readByte(); if (version != SERIAL_VERSION) throw new UnmarshalException("Requested version [" + version + "] does not match local version [" + SERIAL_VERSION + "]."); service = (ServiceProxyAccessor) in.readObject(); }
cachePeer.send(eventMessages); } catch (UnmarshalException e) { String message = e.getMessage(); if (message.contains("Read time out") || message.contains("Read timed out")) { LOG.warn("Unable to send message to remote peer due to socket read timeout. Consider increasing" +
@Override public Object lookup(ServiceTemplate tmpl) throws RemoteException { MarshalledWrapper wrapper = server.lookup(new Template(tmpl)); if (wrapper == null) return null; try { return wrapper.get(); } catch (IOException e) { throw new UnmarshalException("error unmarshalling return", e); } catch (ClassNotFoundException e) { throw new UnmarshalException("error unmarshalling return", e); } }
/** Detect known RMI bugs, notably 52149 or 52150. * * @param unmarshalEx An UnmarshalException which was thrown by rmi. * @return String The failure message for the known RMI bug, or null if no * bug was detected. */ protected static String detectKnownRMIBugs(UnmarshalException unmarshalEx) { String failMessage = unmarshalEx.getMessage(); if ((failMessage != null) && (failMessage.contains("Transport return code invalid"))) { // detected 52150 return failMessage; } else { // look for 52149 Throwable causedBy = unmarshalEx.getCause(); if (causedBy instanceof java.io.InvalidClassException) { failMessage = causedBy.getMessage(); if ((failMessage != null) && (failMessage.contains("Not a proxy"))) { // detected 52149 return failMessage; } } } return null; }
cachePeer.send(eventMessages); } catch (UnmarshalException e) { String message = e.getMessage(); if (message.contains("Read time out") || message.contains("Read timed out")) { LOG.warn("Unable to send message to remote peer due to socket read timeout. Consider increasing" +
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { super.readExternal(in); int version = in.readInt(); if (version != SERIAL_VERSION) throw new UnmarshalException("Class [" + getClass().getName() + "] received version [" + version + "] does not match local version [" + SERIAL_VERSION + "]. Please make sure you are using the same product version on both ends."); final byte flags = in.readByte(); if (flags == 0) return; if ((flags & BitMap._SPACENAME) != 0) _spaceName = (String) in.readObject(); if ((flags & BitMap._CONTAINERNAME) != 0) _containerName = (String) in.readObject(); if ((flags & BitMap._FULLSPACENAME) != 0) _fullSpaceName = (String) in.readObject(); if ((flags & BitMap._SCHEMAPATH) != 0) _schemaPath = (String) in.readObject(); }
public Iterable<Result> fetchResults(MBeanServerConnection mbeanServer, ObjectName queryName) throws InstanceNotFoundException, IntrospectionException, ReflectionException, IOException { ObjectInstance oi = mbeanServer.getObjectInstance(queryName); List<String> attributes; if (attr.isEmpty()) { attributes = new ArrayList<>(); MBeanInfo info = mbeanServer.getMBeanInfo(queryName); for (MBeanAttributeInfo attrInfo : info.getAttributes()) { attributes.add(attrInfo.getName()); } } else { attributes = attr; } try { if (!attributes.isEmpty()) { logger.debug("Executing queryName [{}] from query [{}]", queryName.getCanonicalName(), this); AttributeList al = mbeanServer.getAttributes(queryName, attributes.toArray(new String[attributes.size()])); return new JmxResultProcessor(this, oi, al.asList(), oi.getClassName(), queryName.getDomain()).getResults(); } } catch (UnmarshalException ue) { if ((ue.getCause() != null) && (ue.getCause() instanceof ClassNotFoundException)) { logger.debug("Bad unmarshall, continuing. This is probably ok and due to something like this: " + "http://ehcache.org/xref/net/sf/ehcache/distribution/RMICacheManagerPeerListener.html#52", ue.getMessage()); } else { throw ue; } } return ImmutableList.of(); }
cachePeer.send(eventMessages); } catch (UnmarshalException e) { String message = e.getMessage(); if (message.contains("Read time out") || message.contains("Read timed out")) { LOG.warn("Unable to send message to remote peer due to socket read timeout. Consider increasing" +
public Object lookup(ServiceTemplate tmpl) throws RemoteException { MarshalledWrapper wrapper = getServer().lookup(new Template(tmpl)); if (wrapper == null) return null; try { return wrapper.get(); } catch (IOException e) { throw new UnmarshalException("error unmarshalling return", e); } catch (ClassNotFoundException e) { throw new UnmarshalException("error unmarshalling return", e); } }
if ((ue.getCause() != null) && (ue.getCause() instanceof ClassNotFoundException)) { log.debug("Bad unmarshall, continuing. This is probably ok and due to something like this: " + "http://ehcache.org/xref/net/sf/ehcache/distribution/RMICacheManagerPeerListener.html#52", ue.getMessage());
} catch (UnmarshalException e) { log.error("Removed the attribute " + info.getName() + " of " + mBean + " from the UI list due to: " + e.getMessage()); } catch (RuntimeOperationsException e) { log.error("Removed the attribute " + info.getName() + " of " + mBean +
/** * Samples integrity protection setting (if any) of the stream from which this instance is being * deserialized. */ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); if (name == null) throw new InvalidObjectException("name cannot be null"); integrity = MarshalledWrapper.integrityEnforced(in); if (hash == 0) { try { computeHash(); } catch (Exception e) { throw new UnmarshalException("unable to calculate the type" + " hash for " + name, e); } } }
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { byte serialVersion = in.readByte(); if (serialVersion != SERIAL_VERSION) throw new UnmarshalException("Requested version [" + serialVersion + "] does not match local version [" + SERIAL_VERSION + "]. Please make sure you are using the same version on both ends, service version is " + PlatformVersion.getOfficialVersion()); _logicalVersion = (PlatformLogicalVersion) in.readObject(); //Because handshake request is the last element read from the stream, on older version they should //be able to read the stream successfully and have a remaining data on the end of it which does not //interfere since nothing else is being read from stream afterwards if (_logicalVersion.greaterOrEquals(PlatformLogicalVersion.v9_1_0)) _pid = in.readLong(); }
throw new UnmarshalException("Class [" + getClass().getName() + "] received version [" + version + "] does not match local version [" + SERIAL_VERSION + "]. Please make sure you are using the same version on both ends.");
/** * Activate the object corresponding to this instance. */ @Override public Remote activate(boolean force) throws ActivationException, RemoteException { try { MarshalledWrapper marshalledProxy = activator.activate(this, force); ClassLoader loader = classLoader(); return (Remote) marshalledProxy.get(loader, loader); } catch (RemoteException e) { throw e; } catch (java.io.IOException e) { throw new UnmarshalException("activation failed", e); } catch (java.lang.ClassNotFoundException e) { throw new UnmarshalException("activation failed", e); } }
public Class toClass(String codebase) throws IOException, ClassNotFoundException { Class cls = ClassLoading.loadClass(codebase, name, null, integrity, null); EntryClass local; try { local = ClassMapper.toEntryClassBase(cls).eclass; } catch (MarshalException e) { throw new UnmarshalException("problem obtaining local version of " + toString(), e); } if (hash != local.hash) throw new UnmarshalException("incoming entry type: " + toString() + " is not assignable to the local" + " version of the type: " + local); return cls; }
public Class toClass(String codebase) throws IOException, ClassNotFoundException { Class cls = CodebaseProvider.loadClass(codebase, name, null, integrity, null); EntryClass local; try { local = ClassMapper.toEntryClassBase(cls).eclass; } catch (MarshalException e) { throw new UnmarshalException("problem obtaining local version of " + toString(), e); } if (hash != local.hash) throw new UnmarshalException("incoming entry type: " + toString() + " is not assignable to the local" + " version of the type: " + local); return cls; }