Example usage for java.lang NoClassDefFoundError initCause

List of usage examples for java.lang NoClassDefFoundError initCause

Introduction

In this page you can find the example usage for java.lang NoClassDefFoundError initCause.

Prototype

public synchronized Throwable initCause(Throwable cause) 

Source Link

Document

Initializes the cause of this throwable to the specified value.

Usage

From source file:spring.osgi.context.internal.classloader.BundleDelegatingClassLoader.java

protected Class findClass(String name) throws ClassNotFoundException {
    try {/*from  w  w w  .  ja va2s .  c om*/
        return this.backingBundle.loadClass(name);
    } catch (ClassNotFoundException cnfe) {

        throw new ClassNotFoundException(
                name + " not found from bundle [" + backingBundle.getSymbolicName() + "]", cnfe);
    } catch (NoClassDefFoundError ncdfe) {
        // This is almost always an error
        // This is caused by a dependent class failure,
        // so make sure we search for the right one.
        NoClassDefFoundError e = new NoClassDefFoundError(
                name + " not found from bundle [" + backingBundle + "]");
        e.initCause(ncdfe);
        throw e;
    }
}

From source file:org.beangle.model.persist.hibernate.internal.BundleDelegatingClassLoader.java

protected Class<?> findClass(String name) throws ClassNotFoundException {
    try {//from  ww  w.j a v a  2s  .  c o m
        return this.backingBundle.loadClass(name);
    } catch (ClassNotFoundException cnfe) {
        // DebugUtils.debugClassLoading(backingBundle, name, null);
        throw new ClassNotFoundException(
                name + " not found from bundle [" + backingBundle.getSymbolicName() + "]", cnfe);
    } catch (NoClassDefFoundError ncdfe) {
        // This is almost always an error
        // This is caused by a dependent class failure,
        // so make sure we search for the right one.
        String cname = ncdfe.getMessage().replace('/', '.');
        // DebugUtils.debugClassLoading(backingBundle, cname, name);
        NoClassDefFoundError e = new NoClassDefFoundError(
                cname + " not found from bundle [" + backingBundle + "]");
        e.initCause(ncdfe);
        throw e;
    }
}

From source file:org.eclipse.gemini.blueprint.util.BundleDelegatingClassLoader.java

protected Class<?> findClass(String name) throws ClassNotFoundException {
    try {/*from  ww  w  . j ava2  s  .co  m*/
        return this.backingBundle.loadClass(name);
    } catch (ClassNotFoundException cnfe) {
        DebugUtils.debugClassLoading(backingBundle, name, null);
        throw new ClassNotFoundException(
                name + " not found from bundle [" + backingBundle.getSymbolicName() + "]", cnfe);
    } catch (NoClassDefFoundError ncdfe) {
        // This is almost always an error
        // This is caused by a dependent class failure,
        // so make sure we search for the right one.
        String cname = ncdfe.getMessage().replace('/', '.');
        DebugUtils.debugClassLoading(backingBundle, cname, name);
        NoClassDefFoundError e = new NoClassDefFoundError(name + " not found from bundle ["
                + OsgiStringUtils.nullSafeNameAndSymName(backingBundle) + "]");
        e.initCause(ncdfe);
        throw e;
    }
}