Example usage for java.lang NoClassDefFoundError getMessage

List of usage examples for java.lang NoClassDefFoundError getMessage

Introduction

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

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message string of this throwable.

Usage

From source file:org.apache.sysml.yarn.DMLYarnClientProxy.java

public static boolean launchDMLYarnAppmaster(String dmlScriptStr, DMLConfig conf, String[] allArgs,
        Program rtprog) throws IOException, DMLRuntimeException {
    boolean ret = false;

    try {/*from  w  w w  .j  av  a 2s.  c  om*/
        //check for need for resource optimization
        //if( conf.getIntValue(DMLConfig.YARN_APPMASTERMEM) < 0 )
        //   RESOURCE_OPTIMIZER = true;

        //optimize resources (and update configuration)
        if (DMLAppMasterUtils.isResourceOptimizerEnabled()) {
            LOG.warn("Optimization level '" + OptimizationLevel.O3_LOCAL_RESOURCE_TIME_MEMORY + "' "
                    + "is still in experimental state and not intended for production use.");

            YarnClusterConfig cc = YarnClusterAnalyzer.getClusterConfig();
            DMLAppMasterUtils.setupRemoteParallelTasks(cc);
            ArrayList<ProgramBlock> pb = DMLAppMasterUtils.getRuntimeProgramBlocks(rtprog);
            ResourceConfig rc = ResourceOptimizer.optimizeResourceConfig(pb, cc,
                    GridEnumType.HYBRID_MEM_EXP_GRID, GridEnumType.HYBRID_MEM_EXP_GRID);
            conf.updateYarnMemorySettings(String.valueOf(YarnOptimizerUtils.toMB(rc.getCPResource())),
                    rc.serialize());
            //alternative: only use the max mr memory for all statement blocks
            //conf.updateYarnMemorySettings(String.valueOf(rc.getCPResource()), String.valueOf(rc.getMaxMRResource()));
        }

        //launch dml yarn app master
        DMLYarnClient yclient = new DMLYarnClient(dmlScriptStr, conf, allArgs);
        ret = yclient.launchDMLYarnAppmaster();
    } catch (NoClassDefFoundError ex) {
        LOG.warn("Failed to instantiate DML yarn client " + "(NoClassDefFoundError: " + ex.getMessage() + "). "
                + "Resume with default client processing.");
        ret = false;
    }

    return ret;
}

From source file:com.ibm.bi.dml.yarn.DMLYarnClientProxy.java

/**
 * /*from w ww .ja v a 2s .c  o m*/
 * @param dmlScriptStr
 * @param conf
 * @param allArgs
 * @return
 * @throws IOException 
 * @throws DMLRuntimeException 
 */
public static boolean launchDMLYarnAppmaster(String dmlScriptStr, DMLConfig conf, String[] allArgs,
        Program rtprog) throws IOException, DMLRuntimeException {
    boolean ret = false;

    try {
        //check for need for resource optimization
        //if( conf.getIntValue(DMLConfig.YARN_APPMASTERMEM) < 0 )
        //   RESOURCE_OPTIMIZER = true;

        //optimize resources (and update configuration)
        if (DMLAppMasterUtils.isResourceOptimizerEnabled()) {
            LOG.warn("Optimization level '" + OptimizationLevel.O3_LOCAL_RESOURCE_TIME_MEMORY + "' "
                    + "is still in experimental state and not intended for production use.");

            YarnClusterConfig cc = YarnClusterAnalyzer.getClusterConfig();
            DMLAppMasterUtils.setupRemoteParallelTasks(cc);
            ArrayList<ProgramBlock> pb = DMLAppMasterUtils.getRuntimeProgramBlocks(rtprog);
            ResourceConfig rc = ResourceOptimizer.optimizeResourceConfig(pb, cc,
                    GridEnumType.HYBRID_MEM_EXP_GRID, GridEnumType.HYBRID_MEM_EXP_GRID);
            conf.updateYarnMemorySettings(String.valueOf(YarnOptimizerUtils.toMB(rc.getCPResource())),
                    rc.serialize());
            //alternative: only use the max mr memory for all statement blocks
            //conf.updateYarnMemorySettings(String.valueOf(rc.getCPResource()), String.valueOf(rc.getMaxMRResource()));
        }

        //launch dml yarn app master
        DMLYarnClient yclient = new DMLYarnClient(dmlScriptStr, conf, allArgs);
        ret = yclient.launchDMLYarnAppmaster();
    } catch (NoClassDefFoundError ex) {
        LOG.warn("Failed to instantiate DML yarn client " + "(NoClassDefFoundError: " + ex.getMessage() + "). "
                + "Resume with default client processing.");
        ret = false;
    }

    return ret;
}

From source file:org.appcelerator.annotation.AnnotationHelper.java

@SuppressWarnings("unchecked")
public static Class<? extends Object>[] findAnnotation(Class<? extends Annotation> name) {
    Set<String> set = annotationIndex.get(name.getName());
    Set<Class<? extends Object>> clz = new HashSet<Class<? extends Object>>();
    if (set != null && !set.isEmpty()) {
        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        for (String cn : set) {
            try {
                clz.add(cl.loadClass(cn));
            } catch (NoClassDefFoundError ncd) {
                // this should be OK, just means that we don't have dependency
                LOG.debug("Couldn't load @" + name.getSimpleName() + " from class: " + cn
                        + ". A dependency wasn't found: " + ncd.getMessage());
            } catch (ClassNotFoundException e) {
            }/*from ww  w.j  av  a  2 s .  com*/
        }
    }
    return clz.toArray(new Class[clz.size()]);
}

From source file:com.googlecode.jsfFlex.myFaces.ClassUtils.java

public static Object newInstance(Class clazz) throws FacesException {
    try {/* w  ww  . j a v a2 s.c o  m*/
        return clazz.newInstance();
    } catch (NoClassDefFoundError e) {
        log.error("Class : " + clazz.getName() + " not found.", e);
        throw new FacesException(e);
    } catch (InstantiationException e) {
        log.error(e.getMessage(), e);
        throw new FacesException(e);
    } catch (IllegalAccessException e) {
        log.error(e.getMessage(), e);
        throw new FacesException(e);
    }
}

From source file:org.openadaptor.util.PropertiesPoster.java

/**
 * Sends registration data to a web service.
 * /* w  ww . ja  va2 s .co  m*/
 * @param endpoint - Webservice endpoint.
 * @param properties - data to be sent.
 * @throws Exception
 */
protected static void syncPostWS(String endpoint, Properties properties) throws Exception {
    log.info("Attempt to register via a web service");
    WriterBuilder wsWriterBuilder = new WebServiceWriterBuilder(endpoint, "OA3RegistrationWSCaller");
    OAClient client = null;
    try {
        client = new OAClient(wsWriterBuilder);
    } catch (java.lang.NoClassDefFoundError e) {
        log.error(
                "Error while connecting to registration web service. Make sure cxf-*.jar files are on the classpath. Class not found: "
                        + e.getMessage());
        log.info("Registration failed.");
        return;
    }
    client.send(properties);
    log.info("Registration complete.");
}

From source file:com.net2plan.gui.GUINet2Plan.java

/**
 * Refresh main menu with currently loaded GUI plugins.
 *
 * @since 0.3.1/*w  w w. j  av a 2  s.c  om*/
 */
public static void refreshMenu() {
    instance.usedKeyStrokes.clear();

    while (instance.menu.getComponentCount() > 2)
        instance.menu.remove(1);

    for (Class<? extends Plugin> plugin : PluginSystem.getPlugins(IGUIModule.class)) {
        try {
            IGUIModule pluginInstance = ((Class<? extends IGUIModule>) plugin).newInstance();
            String menuName = pluginInstance.getMenu();
            JMenuItem item = getCurrentMenu(instance.menu, null, menuName);
            item.addActionListener(instance);

            KeyStroke keystroke = pluginInstance.getKeyStroke();
            if (keystroke != null && !instance.usedKeyStrokes.contains(keystroke)) {
                item.setAccelerator(keystroke);
                instance.usedKeyStrokes.add(keystroke);
            }

            instance.itemObject.put(item, plugin);
        } catch (NoClassDefFoundError e) {
            throw new Net2PlanException("Class " + e.getMessage() + " cannot be found. A dependence for "
                    + plugin.getSimpleName() + " is missing?");
        } catch (Throwable e) {
            throw new RuntimeException(e);
        }
    }

    instance.menu.revalidate();
}

From source file:org.apache.myfaces.test.utils.TestUtils.java

/**
 * Create an instance of the class <code>clazz</code>.
 * /*from  ww  w. j a v a2s  . c o  m*/
 * Note: This was copied from org.apache.myfaces.shared.util.ClassUtils
 *
 * @param clazz Class to create an instance of.
 * @return Instance of the class <code>clazz</code>
 * @throws FacesException
 */
private static Object newInstance(Class clazz) throws FacesException {
    try {
        return clazz.newInstance();
    } catch (NoClassDefFoundError e) {
        log.error("Class : " + clazz.getName() + " not found.", e);
        throw new FacesException(e);
    } catch (InstantiationException e) {
        log.error(e.getMessage(), e);
        throw new FacesException(e);
    } catch (IllegalAccessException e) {
        log.error(e.getMessage(), e);
        throw new FacesException(e);
    }
}

From source file:com.manydesigns.portofino.modules.JobModule.java

@Override
public void start() {
    // Quartz integration (optional)
    try {//from  w  w w .  j a v a2 s  . c o m
        // In classe separata per permettere al modulo di essere caricato anche in assenza di Quartz a runtime
        // TODO ??
        // DbScheduler.scheduleNowForOnetime("dbGroup");
        // DbScheduler.schedule("dbGroup");

    } catch (NoClassDefFoundError e) {
        logger.debug(e.getMessage(), e);
        logger.info("Quartz is not available, db job scheduler not started");
    } catch (Exception e) {
        logger.debug(e.getMessage(), e);
        logger.info("Quartz is not available, db job scheduler not started");
    }
    status = ModuleStatus.STARTED;
}

From source file:com.grarak.kerneladiutor.BaseActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Check if darktheme is in use and cache it as boolean
    if (Utils.DARKTHEME = Utils.getBoolean("darktheme", false, this)) {
        super.setTheme(getDarkTheme());
        getWindow().getDecorView().getRootView()
                .setBackgroundColor(ContextCompat.getColor(this, R.color.black));
    }//from w  w w  . j a va2  s . c  om

    if (getParentViewId() != 0)
        setContentView(getParentViewId());
    else if (getParentView() != null)
        setContentView(getParentView());

    Toolbar toolbar;
    if ((toolbar = getToolbar()) != null) {
        if (Utils.DARKTHEME)
            toolbar.setPopupTheme(R.style.ThemeOverlay_AppCompat_Dark);
        try {
            setSupportActionBar(toolbar);
        } catch (NoClassDefFoundError e) {
            Utils.toast(e.getMessage(), this, Toast.LENGTH_LONG);
            finish();
        }
    }

    ActionBar actionBar;
    if ((actionBar = getSupportActionBar()) != null)
        actionBar.setDisplayHomeAsUpEnabled(getDisplayHomeAsUpEnabled());

    setStatusBarColor();
}

From source file:org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.java

public void run(String[] args) {
    Options options = getOptions();/*from  w ww.j a  v  a 2s  .  co m*/
    final CommandLineParser parser = new PosixParser();
    CommandLine line = null;
    try {
        line = parser.parse(options, args);
        if (line.getArgs().length == 0)
            throw new ParseException("No module name specified.");
        if (line.getArgs().length > 1)
            throw new ParseException("Only one module name expected. But " + line.getArgs().length
                    + " were passed (" + line.getArgList() + ")");

        String moduleName = line.getArgs()[0];
        Map<String, String> params = new HashMap<String, String>();
        String[] optionValues = line.getOptionValues(PARAM);
        if (optionValues != null) {
            for (String string : optionValues) {
                int index = string.indexOf('=');
                if (index == -1) {
                    throw new ParseException(
                            "Incorrect parameter syntax '" + string + "'. It should be 'name=value'");
                }
                String name = string.substring(0, index);
                String value = string.substring(index + 1);
                if (params.put(name, value) != null) {
                    throw new ParseException("Duplicate parameter '" + name + "'.");
                }
            }
        }
        // check  OperationCanceledException is accessible
        OperationCanceledException.class.getName();

        Injector injector = new Mwe2StandaloneSetup().createInjectorAndDoEMFRegistration();
        Mwe2Runner mweRunner = injector.getInstance(Mwe2Runner.class);
        if (moduleName.contains("/")) {
            mweRunner.run(URI.createURI(moduleName), params);
        } else {
            mweRunner.run(moduleName, params);
        }
    } catch (NoClassDefFoundError e) {
        if ("org/eclipse/core/runtime/OperationCanceledException".equals(e.getMessage())) {
            System.err.println("Could not load class: org.eclipse.core.runtime.OperationCanceledException");
            System.err.println("Add org.eclipse.equinox.common to the class path.");
        } else {
            throw e;
        }
    } catch (final ParseException exp) {
        final HelpFormatter formatter = new HelpFormatter();
        System.err.println("Parsing arguments failed.  Reason: " + exp.getMessage());
        formatter.printHelp("java " + Mwe2Launcher.class.getName() + " some.mwe2.Module [options]\n", options);
        return;
    }
}