Example usage for java.lang UnsupportedClassVersionError getMessage

List of usage examples for java.lang UnsupportedClassVersionError getMessage

Introduction

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

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message string of this throwable.

Usage

From source file:com.alibaba.jstorm.daemon.nimbus.NimbusCache.java

public NimbusCache(Map conf, StormClusterState zkCluster) {
    super();/* w ww. jav  a 2  s.  c  o  m*/

    String dbCacheClass = getNimbusCacheClass(conf);
    LOG.info("NimbusCache db Cache will use {}", dbCacheClass);

    try {
        dbCache = (JStormCache) Utils.newInstance(dbCacheClass);

        String dbDir = StormConfig.masterDbDir(conf);
        conf.put(RocksDBCache.ROCKSDB_ROOT_DIR, dbDir);

        conf.put(RocksDBCache.ROCKSDB_RESET, ConfigExtension.getNimbusCacheReset(conf));

        dbCache.init(conf);

        if (dbCache instanceof TimeoutMemCache) {
            memCache = dbCache;
        } else {
            memCache = new TimeoutMemCache();
            memCache.init(conf);
        }
    } catch (UnsupportedClassVersionError e) {

        if (e.getMessage().indexOf("Unsupported major.minor version") >= 0) {
            LOG.error("!!!Please update jdk version to 7 or higher!!!");

        }
        LOG.error("Failed to create NimbusCache!", e);
        throw new RuntimeException(e);
    } catch (Exception e) {
        LOG.error("Failed to create NimbusCache!", e);
        throw new RuntimeException(e);
    }

    this.zkCluster = zkCluster;
}

From source file:org.apache.axis2.deployment.AxisConfigBuilder.java

private void processThreadContextMigrators(AxisConfiguration axisConfig, OMElement targetResolvers) {
    if (targetResolvers != null) {
        Iterator iterator = targetResolvers.getChildrenWithName(new QName(TAG_THREAD_CONTEXT_MIGRATOR));
        while (iterator.hasNext()) {
            OMElement threadContextMigrator = (OMElement) iterator.next();
            OMAttribute listIdAttribute = threadContextMigrator.getAttribute(new QName(TAG_LIST_ID));
            String listId = listIdAttribute.getAttributeValue();
            OMAttribute classNameAttribute = threadContextMigrator.getAttribute(new QName(TAG_CLASS_NAME));
            String className = classNameAttribute.getAttributeValue();
            try {
                Class clazz = Loader.loadClass(className);
                ThreadContextMigrator migrator = (ThreadContextMigrator) clazz.newInstance();
                ThreadContextMigratorUtil.addThreadContextMigrator(axisConfig, listId, migrator);
            } catch (UnsupportedClassVersionError e) {
                log.info("Disabled - " + className + " - " + e.getMessage());
            } catch (Exception e) {
                if (log.isTraceEnabled()) {
                    log.trace(//  w w w . ja va 2 s .co m
                            "processThreadContextMigrators: Exception thrown initialising ThreadContextMigrator: "
                                    + e.getMessage());
                }
            }
        }
    }
}

From source file:org.apache.axis2.deployment.AxisConfigBuilder.java

private void processDeployers(Iterator deployerItr) {
    Map<String, Map<String, Deployer>> deployers = new HashMap<String, Map<String, Deployer>>();
    while (deployerItr.hasNext()) {
        OMElement element = (OMElement) deployerItr.next();
        String directory = element.getAttributeValue(new QName(DIRECTORY));
        if (directory == null) {
            log.error("Deployer missing 'directory' attribute : " + element.toString());
            continue;
        }// w  w  w .  j a  v  a2s  .c o m

        String extension = element.getAttributeValue(new QName(EXTENSION));
        if (extension == null) {
            log.error("Deployer missing 'extension' attribute : " + element.toString());
            continue;
        }

        // A leading dot is redundant, so strip it.  So we allow either ".foo" or "foo", either
        // of which will result in extension="foo"
        if (extension.charAt(0) == '.')
            extension = extension.substring(1);

        String deployerClassName = element.getAttributeValue(new QName(TAG_CLASS_NAME));
        Deployer deployer;
        try {
            Class deployerClass = Loader.loadClass(deployerClassName);
            deployer = (Deployer) deployerClass.newInstance();
        } catch (UnsupportedClassVersionError ex) {
            log.info("Disabled - " + deployerClassName + " - " + ex.getMessage());
            continue;
        } catch (Throwable e) {
            log.warn("Unable to instantiate deployer " + deployerClassName
                    + "; see debug logs for more details");
            log.debug(e.getMessage(), e);
            continue;
        }
        deployer.setDirectory(directory);
        deployer.setExtension(extension);

        Map<String, Deployer> extensionMap = deployers.get(directory);
        if (extensionMap == null) {
            extensionMap = new HashMap<String, Deployer>();
            deployers.put(directory, extensionMap);
        }
        extensionMap.put(extension, deployer);
    }
    if (deploymentEngine != null) {
        deploymentEngine.setDeployers(deployers);
    }
}

From source file:org.hyperic.hq.product.ProductPluginManager.java

private Collection<PluginInfo> register(Collection<File> plugins, Collection<PluginInfo> excludes) {
    Collection<PluginInfo> rtn = new ArrayList<PluginInfo>();
    for (File plugin : plugins) {
        String name = plugin.getName();
        if (!isLoadablePluginName(name)) {
            if (isExcluded(name) && excludes != null && plugin.exists() && !plugin.isDirectory()) {
                PluginInfo info = new PluginInfo(plugin, "EXCLUDED");
                excludes.add(info);/*  ww w .  ja v a2s  .c  o  m*/
            }
            continue;
        }
        log.info("Loading plugin: " + name + " (" + plugin.getParent() + ")");
        try {
            PluginInfo info = null;
            if ((info = registerPluginJar(plugin.getAbsolutePath())) != null) {
                rtn.add(info);
            }
        } catch (UnsupportedClassVersionError e) {
            log.info("Cannot load " + name + ": " + unsupportedClassVersionMessage(e.getMessage()));
        } catch (PluginExistsException e) {
            log.debug("Plugin " + name + " already exists.");
        } catch (PluginException e) {
            // ...we're unable to register this particular plugin, log it and press on...
            log.error("A problem occured while registering plugin [" + name + "]", e);
        }
    }
    return rtn;
}