Example usage for java.lang IncompatibleClassChangeError getMessage

List of usage examples for java.lang IncompatibleClassChangeError getMessage

Introduction

In this page you can find the example usage for java.lang IncompatibleClassChangeError getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message string of this throwable.

Usage

From source file:edu.stanford.epad.common.plugins.impl.ClassFinderTestUtils.java

public static void classForName() {
    try {//from w  w  w.j  av a  2s  .  c  om
        Class<?> clazz = Class.forName("edu.stanford.epad.plugins.first.FirstHandler");
        if (clazz != null) {
            logger.info("found FirstHandler by Class.forName");
            // ToDo: add this here.
        } else {
            logger.info("FirstHandler was not found");
        }
    } catch (Exception e) {
        logger.severe("classForName had: ", e);
    } catch (IncompatibleClassChangeError err) {
        logger.severe(err.getMessage(), err);
    }
}

From source file:edu.stanford.epad.common.plugins.impl.ClassFinderTestUtils.java

public static void dynamicClassLoader() {
    try {/*from  w ww .j  a  v a 2  s .  c om*/
        ClassLoader myClassLoader = ClassLoader.getSystemClassLoader();
        // Step 2: Define a class to be loaded.
        String classNameToBeLoaded = "edu.stanford.epad.plugins.first.FirstHandler";
        // Step 3: Load the class
        Class<?> myClass = myClassLoader.loadClass(classNameToBeLoaded);

        if (myClass != null) {
            logger.info("dynamicClassLoader found FirstHandler.");
            // Step 4: create a new instance of that class
            @SuppressWarnings("unused")
            Object whatInstance = myClass.newInstance();
        } else {
            logger.info("FirstHandler was not found");
        }
    } catch (Exception e) {
        logger.warning(e.getMessage(), e);
    } catch (IncompatibleClassChangeError err) {
        logger.warning(err.getMessage(), err);
    }
}