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(); }
@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(); }
@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(); }
@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); } }
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); } }
/** * 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); } } }
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.");
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(); }
/** * 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; }
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 + "]. Please make sure you are using the same version on both ends, local version is " + PlatformVersion.getOfficialVersion()); _majorVersion = in.readByte(); _minorVersion = in.readByte(); _servicePackVersion = in.readByte(); _buildNumber = in.readInt(); _subBuildNumber = in.readInt(); }
ex = in.readObject(); } catch (Exception exc) { throw new UnmarshalException("Error unmarshaling return", exc); throw new UnmarshalException("Return type not Exception");
public boolean authorizeWebService(Method m) throws Exception { Exception ie = null; if (isAWebService()) { try { this.method = m; if (!((com.sun.ejb.Container)container).authorize(this)) { ie = new Exception ("Client not authorized for invocation of method {" + method + "}"); } else { // Record the method on which the successful // authorization check was performed. setWebServiceMethod(m); } } catch(Exception e) { String errorMsg = "Error unmarshalling method {" + method + "} for ejb "; ie = new UnmarshalException(errorMsg); ie.initCause(e); } if ( ie != null ) { exception = ie; throw ie; } } else { setWebServiceMethod(null); } return true; }
private static long check(GetArg arg) throws IOException { String name = (String) arg.get("name", null); // Throws ClassCastException if (name == null) throw new InvalidObjectException("name cannot be null"); long hash = arg.get("hash", 0L); if (hash == 0) { try { hash = computeHash(name); } catch (Exception e) { throw new UnmarshalException("unable to calculate the type" + " hash for " + name, e); } } Object superclass = arg.get("superclass", null); // Throws ClassCastException if (superclass != null && !(superclass instanceof ServiceType)){ throw new InvalidObjectException( "superclass must be instances of ServiceType"); } Object interfaces = arg.get("interfaces", null); // Throws ClassCastException if (interfaces != null && !(interfaces instanceof ServiceType[])){ throw new InvalidObjectException( "interfaces must be instances of ServiceType[]"); } return hash; }
public boolean authorizeWebService(Method m) throws Exception { Exception ie = null; if (isAWebService()) { try { this.method = m; if (!((com.sun.ejb.Container)container).authorize(this)) { ie = new Exception ("Client not authorized for invocation of method {" + method + "}"); } else { // Record the method on which the successful // authorization check was performed. setWebServiceMethod(m); } } catch(Exception e) { String errorMsg = "Error unmarshalling method {" + method + "} for ejb "; ie = new UnmarshalException(errorMsg); ie.initCause(e); } if ( ie != null ) { exception = ie; throw ie; } } else { setWebServiceMethod(null); } return true; }
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 + "]. Please make sure you are using the same version on both ends, local version is " + PlatformVersion.getOfficialVersion()); _platformLogicalVersion = (PlatformLogicalVersion) in.readObject(); _platformVersion = in.readUTF();
public boolean handleRequest(MessageContext context) { WebComponentInvocation inv = null; try { WebServiceContractImpl wscImpl = WebServiceContractImpl.getInstance(); InvocationManager invManager = wscImpl.getInvocationManager(); inv = (WebComponentInvocation) invManager.getCurrentInvocation(); Method webServiceMethodInPreHandler = inv.getWebServiceMethod(); if( webServiceMethodInPreHandler != null ) { // Now that application handlers have run, do another method // lookup and compare the results with the original one. This // ensures that the application handlers have not changed // the message context in any way that would impact which // method is invoked. Method postHandlerMethod = wsUtil.getInvMethod( (com.sun.xml.rpc.spi.runtime.Tie)inv.getWebServiceTie(), context); if( !webServiceMethodInPreHandler.equals(postHandlerMethod) ) { throw new UnmarshalException("Original method " + webServiceMethodInPreHandler + " does not match post-handler method "); } } } catch(Exception e) { logger.log(Level.WARNING, format(rb.getString("postWebHandlerError"), e.toString())); wsUtil.throwSOAPFaultException(e.getMessage(), context); } return true; }
public boolean handleRequest(MessageContext context) { EJBInvocation inv = null; try { WebServiceContractImpl wscImpl = WebServiceContractImpl.getInstance(); InvocationManager invManager = wscImpl.getInvocationManager(); inv = (EJBInvocation) invManager.getCurrentInvocation(); Method webServiceMethodInPreHandler = inv.getWebServiceMethod(); if( webServiceMethodInPreHandler != null ) { // Now that application handlers have run, do another method // lookup and compare the results with the original one. This // ensures that the application handlers have not changed // the message context in any way that would impact which // method is invoked. Method postHandlerMethod = wsUtil.getInvMethod( (com.sun.xml.rpc.spi.runtime.Tie)inv.getWebServiceTie(), context); if( !webServiceMethodInPreHandler.equals(postHandlerMethod) ) { throw new UnmarshalException("Original method " + webServiceMethodInPreHandler + " does not match post-handler method "); } } } catch(Exception e) { wsUtil.throwSOAPFaultException(e.getMessage(), context); } return true; } }
public void readExternal(AnnotatedObjectInputStream 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."); LRMIRemoteClassLoaderIdentifier remoteClassLoaderId = RemoteClassLoaderContext.get(); LRMIRemoteClassLoaderIdentifier previousIdentifier = null; if (remoteClassLoaderId != null) previousIdentifier = LRMIConnection.setRemoteClassLoaderIdentifier(remoteClassLoaderId); result = (T) in.readUnshared(); exception = (Exception) in.readUnshared(); if (remoteClassLoaderId != null) LRMIConnection.setRemoteClassLoaderIdentifier(previousIdentifier); }