/** * 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); } }
/** * 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); } }
Ln.w(error.getCause()); } catch (ClassNotFoundException error) { Ln.w(error.getCause());
classLoader); } catch (ClassNotFoundException e) { Throwable cause = e.getCause(); if (cause instanceof ExceptionInInitializerError) { throw (ExceptionInInitializerError) cause;
Throwable cause = ex.getCause(); if (cause instanceof ResourceNotFoundException) { String resourceName = ((ResourceNotFoundException) cause).getResourceName();
public Class<?> loadClassLocal(final String name, final boolean resolve) { try { return Class.forName(name, resolve, classLoader); } catch (ClassNotFoundException e) { final Throwable cause = e.getCause(); if (cause instanceof Error) { throw (Error) cause; } else if (cause instanceof RuntimeException) { //unlikely throw (RuntimeException) cause; } return null; } }
public Class<?> loadClassLocal(final String name, final boolean resolve) { try { return ModuleClassLoader.this.loadClassLocal(name, resolve); } catch (ClassNotFoundException e) { final Throwable cause = e.getCause(); if (cause instanceof Error) { throw (Error) cause; } else if (cause instanceof RuntimeException) { //unlikely throw (RuntimeException) cause; } return null; } }
private Reflect(String className) { checkNotEmpty(className, "ClassName can not be empty!"); try { this.mReflectObjectClazz = Class.forName(className); } catch (ClassNotFoundException e) { throw new ReflectException("Class:" + className + " can not be found!", e.getCause()); } }
private Reflect(String className) { checkNotEmpty(className, "ClassName can not be empty!"); try { this.mReflectObjectClazz = Class.forName(className); } catch (ClassNotFoundException e) { throw new ReflectException("Class:" + className + " can not be found!", e.getCause()); } }
/** * Return a template compiled by the configured Groovy Markup template engine * for the given view URL. */ protected Template getTemplate(String viewUrl) throws Exception { 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); } }
@Override public void onReturn(Response resp) { Object netObj = extractResult(resp); try { @SuppressWarnings("unchecked") T target = (T) codec.convert(netObj, clazz); callback.onReturn(target); } catch (ClassNotFoundException e) { throw new RpcException(e.getMessage(), e.getCause()); } } });
public Class<?> getClazz() { if (clazz == null) { try { clazz = TypesLoaderVisitor.getClassLoader().loadClass(this); } catch (ClassNotFoundException e) { throw new TypeNotFoundException("Error resolving the class for " + name, e.getCause()); } } return clazz; }
public <T> T invokeSync(Class<T> resultClass, Request request){ Response resp = invokeSync(request); try { @SuppressWarnings("unchecked") T res = (T)codec.convert(extractResult(resp), resultClass); return res; } catch (ClassNotFoundException e) { throw new RpcException(e.getMessage(), e.getCause()); } }
/** * Finds a class local to this bundle. Only the classloader for this bundle is searched. * @param name The name of the class to find. * @return The loaded Class or null if the class is not found. * @throws ClassNotFoundException */ public Class<?> findLocalClass(String name) throws ClassNotFoundException { long start = 0; if (debug.DEBUG_LOADER) { Debug.println("BundleLoader[" + this + "].findLocalClass(" + name + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ start = System.currentTimeMillis(); } try { Class<?> clazz = getModuleClassLoader().findLocalClass(name); if (debug.DEBUG_LOADER && clazz != null) { long time = System.currentTimeMillis() - start; Debug.println("BundleLoader[" + this + "] found local class " + name + " " + time + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ } return clazz; } catch (ClassNotFoundException e) { if (e.getCause() instanceof BundleException) { // Here we assume this is because of a lazy activation error throw e; } return null; } }
/** * Finds a class local to this bundle. Only the classloader for this bundle is searched. * @param name The name of the class to find. * @return The loaded Class or null if the class is not found. * @throws ClassNotFoundException */ public Class<?> findLocalClass(String name) throws ClassNotFoundException { long start = 0; if (debug.DEBUG_LOADER) { Debug.println("BundleLoader[" + this + "].findLocalClass(" + name + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ start = System.currentTimeMillis(); } try { Class<?> clazz = getModuleClassLoader().findLocalClass(name); if (debug.DEBUG_LOADER && clazz != null) { long time = System.currentTimeMillis() - start; Debug.println("BundleLoader[" + this + "] found local class " + name + " " + time + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ } return clazz; } catch (ClassNotFoundException e) { if (e.getCause() instanceof BundleException) { // Here we assume this is because of a lazy activation error throw e; } return null; } }
Throwable cause = ex.getCause(); if (cause instanceof ResourceNotFoundException) { String resourceName = ((ResourceNotFoundException) cause).getResourceName();
/** * Finds a class local to this bundle. Only the classloader for this bundle is searched. * @param name The name of the class to find. * @return The loaded Class or null if the class is not found. * @throws ClassNotFoundException */ public Class<?> findLocalClass(String name) throws ClassNotFoundException { long start = 0; if (debug.DEBUG_LOADER) { Debug.println("BundleLoader[" + this + "].findLocalClass(" + name + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ start = System.currentTimeMillis(); } try { Class<?> clazz = getModuleClassLoader().findLocalClass(name); if (debug.DEBUG_LOADER && clazz != null) { long time = System.currentTimeMillis() - start; Debug.println("BundleLoader[" + this + "] found local class " + name + " " + time + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ } return clazz; } catch (ClassNotFoundException e) { if (e.getCause() instanceof BundleException) { // Here we assume this is because of a lazy activation error throw e; } return null; } }
/** * Finds a class local to this bundle. Only the classloader for this bundle is searched. * @param name The name of the class to find. * @return The loaded Class or null if the class is not found. * @throws ClassNotFoundException */ public Class<?> findLocalClass(String name) throws ClassNotFoundException { long start = 0; if (debug.DEBUG_LOADER) { Debug.println("BundleLoader[" + this + "].findLocalClass(" + name + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ start = System.currentTimeMillis(); } try { Class<?> clazz = getModuleClassLoader().findLocalClass(name); if (debug.DEBUG_LOADER && clazz != null) { long time = System.currentTimeMillis() - start; Debug.println("BundleLoader[" + this + "] found local class " + name + " " + time + "ms"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ } return clazz; } catch (ClassNotFoundException e) { if (e.getCause() instanceof BundleException) { // Here we assume this is because of a lazy activation error throw e; } return null; } }
/** * Finds a class local to this bundle. Only the classloader for this bundle is searched. * @param name The name of the class to find. * @return The loaded Class or null if the class is not found. * @throws ClassNotFoundException */ public Class<?> findLocalClass(String name) throws ClassNotFoundException { if (debug.DEBUG_LOADER) Debug.println("BundleLoader[" + this + "].findLocalClass(" + name + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ try { Class<?> clazz = getModuleClassLoader().findLocalClass(name); if (debug.DEBUG_LOADER && clazz != null) Debug.println("BundleLoader[" + this + "] found local class " + name); //$NON-NLS-1$ //$NON-NLS-2$ return clazz; } catch (ClassNotFoundException e) { if (e.getCause() instanceof BundleException) { // Here we assume this is because of a lazy activation error throw e; } return null; } }
/** * Finds a class local to this bundle. Only the classloader for this bundle is searched. * @param name The name of the class to find. * @return The loaded Class or null if the class is not found. * @throws ClassNotFoundException */ public Class<?> findLocalClass(String name) throws ClassNotFoundException { if (debug.DEBUG_LOADER) Debug.println("BundleLoader[" + this + "].findLocalClass(" + name + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ try { Class<?> clazz = getModuleClassLoader().findLocalClass(name); if (debug.DEBUG_LOADER && clazz != null) Debug.println("BundleLoader[" + this + "] found local class " + name); //$NON-NLS-1$ //$NON-NLS-2$ return clazz; } catch (ClassNotFoundException e) { if (e.getCause() instanceof BundleException) { // Here we assume this is because of a lazy activation error throw e; } return null; } }