Package java.io

Examples of java.io.InvalidClassException


    public void test_ConstructorLjava_lang_StringLjava_lang_String() {
        final String message = "A message";
        final String className = "Object";
        try {
            if (true) {
                throw new InvalidClassException(className, message);
            }
            fail("Failed to throw exception");
        } catch (InvalidClassException e) {
            // correct
            String returnedMessage = e.getMessage();
View Full Code Here


  createAndRegisterLease(
      new LinkageError("Synthetic LinkageError"),
      false, set);
  createAndRegisterLease(
      new MarshalException("Synthetic MarshalException",
          new InvalidClassException("Synthetic")),
          true, set);
  createAndRegisterLease(
      new MarshalException("Synthetic MarshalException", null),
         false, set);
  createAndRegisterLease(
      new MarshalException("Synthetic MarshalException",
         new IOException()),
         false, set);
  createAndRegisterLease(
      new UnmarshalException("Synthetic UnmarshalException",
           new InvalidClassException("Synthetic")),
           true, set);
  createAndRegisterLease(
      new UnmarshalException("Synthetic UnmarshalException", null),
           false, set);
  createAndRegisterLease(
      new UnmarshalException("Synthetic UnmarshalException",
           new IOException()),
           false, set);
  createAndRegisterLease(
      new ServerException("Synthetic ServerException",
        new RemoteException()),
        false, set);
  createAndRegisterLease(
      new ServerException("Synthetic ServerException",
        new NoSuchObjectException("Synthetic")),
        true, set);
  createAndRegisterLease(
      new ServerException("Synthetic ServerException",
        new UnmarshalException("Synthetic UnmarshalException",
                   new InvalidClassException("Synthetic"))),
        true, set);


  // Wait for failures to hapen and events to be recieved
  final long sleepTime =
View Full Code Here

      {
        clazz = Class.forName(type);
      }
      catch (ClassNotFoundException e)
      {
        throw new InvalidClassException(type, "could not resolve class [" + type +
          "] when deserializing proxy");
      }

      return LazyInitProxyFactory.createProxy(clazz, locator);
    }
View Full Code Here

     */
    protected Object readResolve() throws ObjectStreamException {
        Enum enumObj = Enum.getEnumByName(getClass(), getName());

        if (enumObj == null || !enumObj.value.equals(value)) {
            throw new InvalidClassException(getClass().getName());
        }

        return enumObj;
    }
View Full Code Here

        try {
            SEIFactoryImpl seiFactory =  new SEIFactoryImpl(serviceName, portQName.getLocalPart(), serviceEndpointClass, operationInfos, serviceImpl, typeInfo, location, handlerInfos, null, credentialsName);
//            seiFactory.initialize();
            return seiFactory;
        } catch (ClassNotFoundException e) {
            throw new InvalidClassException(GenericServiceEndpoint.class.getName(), "this is impossible");
        }
    }
View Full Code Here

                CurrencyUnit obj = (CurrencyUnit) object;
                writeCurrency(out, obj);
                return;
            }
        }
        throw new InvalidClassException("Joda-Money bug: Serialization broken");
    }
View Full Code Here

      {
        clazz = Class.forName(type);
      }
      catch (ClassNotFoundException e)
      {
        throw new InvalidClassException(type, "could not resolve class [" + type +
          "] when deserializing proxy");
      }

      return LazyInitProxyFactory.createProxy(clazz, locator);
    }
View Full Code Here

            this.fileVersion = Integer.parseInt(
                    props.getProperty( PROPERTIES_FILE_VERSION ).trim() );
        }
        else
        {
            throw new InvalidClassException( "Property "
                    + PROPERTIES_FILE_VERSION + " is missing in properties: "
                    + props );
        }
       
        if ( this.fileVersion < MIN_FILE_VERSION
View Full Code Here

        @Override
        protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException,
            ClassNotFoundException {

            if (!whitelist.isEnabled(desc.getName())) {
                throw new InvalidClassException("Unauthorized deserialization attempt", desc.getName());
            }

            return super.resolveClass(desc);
        }
View Full Code Here

          throw e;
        }
        if (object instanceof JmxMonitorListener) {
          listener = (JmxMonitorListener) object;
        } else {
          throw new InvalidClassException(
                  "Invalid Monitor Formatter Class:"
                          + formatterListenerClass
                          + ".The Monitor Requires a Formatter Which Implements:org.apache.uima.aae.jmx.monitor.JmxMonitorListener");
        }
      } else {
View Full Code Here

TOP

Related Classes of java.io.InvalidClassException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.