Package java.io

Examples of java.io.InvalidClassException.initCause()


    }

    public static InvalidClassException newInvalidClassException(Class clazz,
                                                                 Throwable cause) {
        InvalidClassException exception = new InvalidClassException( clazz.getName() );
        exception.initCause( cause );
        return exception;
    }

    public ClassLoader getClassLoader() {
        return this.classLoader;
View Full Code Here


    }

    public static InvalidClassException newInvalidClassException(Class clazz,
                                                                 Throwable cause) {
        InvalidClassException exception = new InvalidClassException( clazz.getName() );
        exception.initCause( cause );
        return exception;
    }

    public ClassLoader getClassLoader() {
        return this.classLoader;
View Full Code Here

        final Constructor<T> constructor = getNewConstructor(clazz);
        try {
            return constructor.newInstance();
        } catch (InvocationTargetException e) {
            final InvalidClassException ice = new InvalidClassException(clazz.getName(), "Constructor threw an exception");
            ice.initCause(e);
            throw ice;
        } catch (IllegalAccessException e) {
            throw new InvalidClassException(clazz.getName(), "Illegal access exception occurred accessing the constructor: " + String.valueOf(e));
        } catch (InstantiationException e) {
            throw new InvalidClassException(clazz.getName(), "Instantiation exception: " + String.valueOf(e));
View Full Code Here

                    if (realField !=  null) realField.set(subject, serialUnmarshaller.readObject());
                }
            }
        } catch (IllegalAccessException e) {
            final InvalidClassException ice = new InvalidClassException("Unexpected illegal access");
            ice.initCause(e);
            throw ice;
        }
    }

    ObjectInputStream.GetField getField(final SerialUnmarshaller serialUnmarshaller, final SerializableClass sc) throws IOException, ClassNotFoundException {
View Full Code Here

                    className = (String) unmarshaller.readObject();
                    try {
                        classLoader = moduleLoader.loadModule(identifier).getClassLoader();
                    } catch (ModuleLoadException e) {
                        final InvalidClassException ce = new InvalidClassException(className, "Module load failed");
                        ce.initCause(e);
                        throw ce;
                    }
                }
                return Class.forName(className, false, classLoader);
            }
View Full Code Here

                    final Module module;
                    try {
                        module = moduleLoader.loadModule(identifier);
                    } catch (ModuleLoadException e) {
                        final InvalidClassException ce = new InvalidClassException("Module load failed");
                        ce.initCause(e);
                        throw ce;
                    }
                    classLoader = module.getClassLoader();
                }
                final int len = unmarshaller.readInt();
View Full Code Here

    public <T> T create(final Class<T> clazz) throws InvalidClassException {
        try {
            return clazz.newInstance();
        } catch (Exception e) {
            final InvalidClassException ee = new InvalidClassException(clazz.getName(), e.getMessage());
            ee.initCause(e);
            throw ee;
        }
    }
}
View Full Code Here

            final Module module;
            try {
                module = moduleLoader.loadModule(identifier);
            } catch (ModuleLoadException e) {
                final InvalidClassException ce = new InvalidClassException("Module load failed");
                ce.initCause(e);
                throw ce;
            }
            classLoader = module.getClassLoader();
        }
        final int len = names.length;
View Full Code Here

        final ModuleIdentifier identifier = ModuleIdentifier.create(name, slot);
        try {
            return Class.forName(className, false, moduleLoader.loadModule(identifier).getClassLoader());
        } catch (ModuleLoadException e) {
            final InvalidClassException ce = new InvalidClassException(className, "Module load failed");
            ce.initCause(e);
            throw ce;
        }
    }

    /** {@inheritDoc} */
 
View Full Code Here

                }
            } catch (InvocationTargetException e) {
                InvalidClassException exc = new InvalidClassException(
                    currentClass.getName(),
                    "InvocationTargetException accessing no-arg constructor");
                exc.initCause( e ) ;
                throw exc ;
            } catch (UnsupportedOperationException e) {
                InvalidClassException exc = new InvalidClassException(
                    currentClass.getName(),
                    "UnsupportedOperationException accessing no-arg constructor");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.