public static NoClassDefFoundError fail(ClassNotFoundException e) { return new NoClassDefFoundError(e.getMessage()); } }
public static Class<?> forName(String className) { try { return classForName(className); } catch (ClassNotFoundException e) { throw new IllegalStateException(e.getMessage(), e); } }
public static Class<?> forName(String className) { try { return classForName(className); } catch (ClassNotFoundException e) { throw new IllegalStateException(e.getMessage(), e); } }
public static Class<?> forName(ClassLoader cl, String name) { try { return name2class(cl, name); } catch (ClassNotFoundException e) { throw new IllegalStateException("Not found class " + name + ", cause: " + e.getMessage(), e); } }
public static Class<?> forName(ClassLoader cl, String name) { try { return name2class(cl, name); } catch (ClassNotFoundException e) { throw new IllegalStateException("Not found class " + name + ", cause: " + e.getMessage(), e); } }
public static Class<?> forName(String name) { try { return name2class(name); } catch (ClassNotFoundException e) { throw new IllegalStateException("Not found class " + name + ", cause: " + e.getMessage(), e); } }
public static Class<?> forName(String name) { try { return name2class(name); } catch (ClassNotFoundException e) { throw new IllegalStateException("Not found class " + name + ", cause: " + e.getMessage(), e); } }
public Class<?> getInterfaceClass() { if (interfaceClass != null) { return interfaceClass; } if (ref instanceof GenericService) { return GenericService.class; } try { if (interfaceName != null && interfaceName.length() > 0) { this.interfaceClass = Class.forName(interfaceName, true, Thread.currentThread() .getContextClassLoader()); } } catch (ClassNotFoundException t) { throw new IllegalStateException(t.getMessage(), t); } return interfaceClass; }
public Class<?> getInterfaceClass() { if (interfaceClass != null) { return interfaceClass; } if (ref instanceof GenericService) { return GenericService.class; } try { if (interfaceName != null && interfaceName.length() > 0) { this.interfaceClass = Class.forName(interfaceName, true, Thread.currentThread() .getContextClassLoader()); } } catch (ClassNotFoundException t) { throw new IllegalStateException(t.getMessage(), t); } return interfaceClass; }
@SuppressWarnings("unchecked") private Class<IN> getType(String name) { Class<IN> type = types.get(name); if (null == type) { try { type = (Class<IN>) Class.forName(name); } catch (ClassNotFoundException e) { throw new IllegalArgumentException(e.getMessage(), e); } types.put(name, type); } return type; }
@SuppressWarnings("unchecked") public T newInstance() { try { return (T) inputStream.readObject(); } catch(ClassNotFoundException e) { throw new Error("ClassNotFoundException: " + e.getMessage()); } catch(Exception e) { throw new ObjenesisException(e); } } }
private static String getterName( Exception t) { if (t instanceof ClassNotFoundException ) { return ( (ClassNotFoundException) t ).getMessage(); } else { return "?"; } }
public static Class<?> forName(String[] packages, String className) { try { return classForName(className); } catch (ClassNotFoundException e) { if (packages != null && packages.length > 0) { for (String pkg : packages) { try { return classForName(pkg + "." + className); } catch (ClassNotFoundException e2) { } } } throw new IllegalStateException(e.getMessage(), e); } }
public static Class<?> forName(String[] packages, String className) { try { return classForName(className); } catch (ClassNotFoundException e) { if (packages != null && packages.length > 0) { for (String pkg : packages) { try { return classForName(pkg + "." + className); } catch (ClassNotFoundException e2) { } } } throw new IllegalStateException(e.getMessage(), e); } }
/** * Obtains the display name of the given initialization task */ protected String getDisplayNameOf(Method e, T i) { Class<?> c = e.getDeclaringClass(); String key = displayNameOf(i); if (key.length()==0) return c.getSimpleName()+"."+e.getName(); try { ResourceBundleHolder rb = ResourceBundleHolder.get( c.getClassLoader().loadClass(c.getPackage().getName() + ".Messages")); return rb.format(key); } catch (ClassNotFoundException x) { LOGGER.log(WARNING, "Failed to load "+x.getMessage()+" for "+e.toString(),x); return key; } catch (MissingResourceException x) { LOGGER.log(WARNING, "Could not find key '" + key + "' in " + c.getPackage().getName() + ".Messages", x); return key; } }
public Class<?> getInterfaceClass() { if (interfaceClass != null) { return interfaceClass; } if (isGeneric() || (getConsumer() != null && getConsumer().isGeneric())) { return GenericService.class; } try { if (interfaceName != null && interfaceName.length() > 0) { this.interfaceClass = Class.forName(interfaceName, true, ClassHelper.getClassLoader()); } } catch (ClassNotFoundException t) { throw new IllegalStateException(t.getMessage(), t); } return interfaceClass; }
public Class<?> getInterfaceClass() { if (interfaceClass != null) { return interfaceClass; } if (isGeneric() || (getConsumer() != null && getConsumer().isGeneric())) { return GenericService.class; } try { if (interfaceName != null && interfaceName.length() > 0) { this.interfaceClass = Class.forName(interfaceName, true, ClassHelper.getClassLoader()); } } catch (ClassNotFoundException t) { throw new IllegalStateException(t.getMessage(), t); } return interfaceClass; }
/** * Return a template compiled by the configured Groovy Markup template engine * for the given view URL. */ protected Template getTemplate(String viewUrl) throws Exception { Assert.state(this.engine != null, "No MarkupTemplateEngine set"); try { return this.engine.createTemplateByPath(viewUrl); } catch (ClassNotFoundException ex) { Throwable cause = (ex.getCause() != null ? ex.getCause() : ex); throw new NestedServletException( "Could not find class while rendering Groovy Markup view with name '" + getUrl() + "': " + ex.getMessage() + "'", cause); } }
.getContextClassLoader()); } catch (ClassNotFoundException e) { throw new IllegalStateException(e.getMessage(), e);
.getContextClassLoader()); } catch (ClassNotFoundException e) { throw new IllegalStateException(e.getMessage(), e);