/** * Constructs a CannotInvokeException with an ClassNotFoundException. */ public CannotInvokeException(ClassNotFoundException e) { super("by " + e.toString()); err = e; } }
/** * Constructs a CannotInvokeException with an ClassNotFoundException. */ public CannotInvokeException(ClassNotFoundException e) { super("by " + e.toString()); err = e; } }
/** * Constructs a CannotInvokeException with an ClassNotFoundException. */ public CannotInvokeException(ClassNotFoundException e) { super("by " + e.toString()); err = e; } }
/** * Constructs a CannotInvokeException with an ClassNotFoundException. */ public CannotInvokeException(ClassNotFoundException e) { super("by " + e.toString()); err = e; } }
@Override @SuppressWarnings("unchecked") public T deserialize(T object) throws IOException { try { // ignore passed-in object return (T) ois.readObject(); } catch (ClassNotFoundException e) { throw new IOException(e.toString()); } }
/** * Creates a new instance of com.sun.jdmk.comm.HtmlAdapterServer * using reflection. * * @since 1.2.16 * @return new instance. */ private static Object createServer() { Object newInstance = null; try { newInstance = Class.forName( "com.sun.jdmk.comm.HtmlAdapterServer").newInstance(); } catch (ClassNotFoundException ex) { throw new RuntimeException(ex.toString()); } catch (InstantiationException ex) { throw new RuntimeException(ex.toString()); } catch (IllegalAccessException ex) { throw new RuntimeException(ex.toString()); } return newInstance; }
protected Class getClass(final Type t) { try { if (t.getSort() == Type.ARRAY) { return Class.forName(t.getDescriptor().replace('/', '.')); } return Class.forName(t.getClassName()); } catch (ClassNotFoundException e) { throw new RuntimeException(e.toString()); } } }
private Class<?> getClass( Type type ) { try { if ( type.getSort() == Type.ARRAY ) { return Class.forName( type.getDescriptor().replace( '/', '.' ), false, classpathLoader ); } return Class.forName( type.getClassName(), false, classpathLoader ); } catch ( ClassNotFoundException e ) { throw new RuntimeException( e.toString() ); } } }
/** * Load the Class object for the configured validation class name. * @param loader The ClassLoader used to load the Class object. * @throws ValidatorException */ private void loadValidationClass(ClassLoader loader) throws ValidatorException { if (this.validationClass != null) { return; } try { this.validationClass = loader.loadClass(this.classname); } catch (ClassNotFoundException e) { throw new ValidatorException(e.toString()); } }
@Override public void reportMissingClass(ClassNotFoundException ex) { if (DEBUG_MISSING_CLASSES) { System.out.println("Missing class: " + ex.toString()); ex.printStackTrace(System.out); } if (verbosityLevel == SILENT) { return; } logMissingClass(getMissingClassName(ex)); }
@Override public void readFields(DataInput in) throws IOException { String className = UTF8.readString(in); declaredClass = PRIMITIVE_NAMES.get(className); if (declaredClass == null) { try { declaredClass = getConf().getClassByName(className); } catch (ClassNotFoundException e) { throw new RuntimeException(e.toString()); } } } @Override
public static ComplianceIndexingOperationListener instantiateComplianceListener(ComplianceConfig complianceConfig, AuditLog auditlog) { if (enterpriseModulesDisabled()) { return new ComplianceIndexingOperationListener(); } try { final Class<?> clazz = Class.forName("com.floragunn.searchguard.compliance.ComplianceIndexingOperationListenerImpl"); final ComplianceIndexingOperationListener impl = (ComplianceIndexingOperationListener) clazz .getConstructor(ComplianceConfig.class, AuditLog.class) .newInstance(complianceConfig, auditlog); //no addLoadedModule(clazz) here because its not a typical module //and it is not loaded in every case/on every node return impl; } catch (final ClassNotFoundException e) { //TODO produce a single warn msg, this here is issued for every index log.debug("Unable to enable Compliance Module due to {}", e.toString()); if(log.isDebugEnabled()) { log.debug("Stacktrace: ",e); } return new ComplianceIndexingOperationListener(); } catch (final Throwable e) { log.error("Unable to enable Compliance Module due to {}", e.toString()); if(log.isDebugEnabled()) { log.debug("Stacktrace: ",e); } return new ComplianceIndexingOperationListener(); } }
LOG.debug(e.toString());
/** * Loads the class corresponding to the given type. The class is loaded with the class loader * specified with {@link #setClassLoader}, or with the class loader of this class if no class * loader was specified. * * @param type a type. * @return the class corresponding to 'type'. */ protected Class<?> getClass(final Type type) { try { if (type.getSort() == Type.ARRAY) { return Class.forName(type.getDescriptor().replace('/', '.'), false, loader); } return Class.forName(type.getClassName(), false, loader); } catch (ClassNotFoundException e) { throw new TypeNotPresentException(e.toString(), e); } } }
/** * Loads the class corresponding to the given type. The class is loaded with the class loader * specified with {@link #setClassLoader}, or with the class loader of this class if no class * loader was specified. * * @param type a type. * @return the class corresponding to 'type'. */ protected Class<?> getClass(final Type type) { try { if (type.getSort() == Type.ARRAY) { return Class.forName(type.getDescriptor().replace('/', '.'), false, loader); } return Class.forName(type.getClassName(), false, loader); } catch (ClassNotFoundException e) { throw new TypeNotPresentException(e.toString(), e); } } }
public String testConnection() { StringBuilder report = new StringBuilder(); // If the plug-in needs to provide connection information, we ask the DatabaseInterface... // try { DatabaseFactoryInterface factory = getDatabaseFactory(); return factory.getConnectionTestReport( this ); } catch ( ClassNotFoundException e ) { report .append( BaseMessages.getString( PKG, "BaseDatabaseMeta.TestConnectionReportNotImplemented.Message" ) ) .append( Const.CR ); report.append( BaseMessages.getString( PKG, "DatabaseMeta.report.ConnectionError", getName() ) + e.toString() + Const.CR ); report.append( Const.getStackTracker( e ) + Const.CR ); } catch ( Exception e ) { report.append( BaseMessages.getString( PKG, "DatabaseMeta.report.ConnectionError", getName() ) + e.toString() + Const.CR ); report.append( Const.getStackTracker( e ) + Const.CR ); } return report.toString(); }
throw new InvalidClassException(cnf.toString());
public DatabaseTestResults testConnectionSuccess() { StringBuilder report = new StringBuilder(); DatabaseTestResults databaseTestResults = new DatabaseTestResults(); // If the plug-in needs to provide connection information, we ask the DatabaseInterface... // try { DatabaseFactoryInterface factory = getDatabaseFactory(); databaseTestResults = factory.getConnectionTestResults( this ); } catch ( ClassNotFoundException e ) { report .append( BaseMessages.getString( PKG, "BaseDatabaseMeta.TestConnectionReportNotImplemented.Message" ) ) .append( Const.CR ); report.append( BaseMessages.getString( PKG, "DatabaseMeta.report.ConnectionError", getName() ) + e.toString() + Const.CR ); report.append( Const.getStackTracker( e ) + Const.CR ); databaseTestResults.setMessage( report.toString() ); databaseTestResults.setSuccess( false ); } catch ( Exception e ) { report.append( BaseMessages.getString( PKG, "DatabaseMeta.report.ConnectionError", getName() ) + e.toString() + Const.CR ); report.append( Const.getStackTracker( e ) + Const.CR ); databaseTestResults.setMessage( report.toString() ); databaseTestResults.setSuccess( false ); } return databaseTestResults; }
public PriorityBuffer serializeAndRestore(PriorityBuffer h) { PriorityBuffer h1 = null; try { byte[] objekt = writeExternalFormToBytes(h); h1 = (PriorityBuffer) readExternalFormFromBytes(objekt); } catch (IOException e) { e.printStackTrace(); fail(e.toString()); } catch (ClassNotFoundException e) { e.printStackTrace(); fail(e.toString()); } return h1; }
logger.debug("Failed to load class " + s + ": " + ex); Error e = new NoClassDefFoundError(ex.toString()); e.initCause(ex); throw e;