- Common ways to obtain StartException
private void myMethod () {StartException s =
Throwable cause;new StartException(cause)
ServiceController controller;controller.getStartException()
String str;Throwable cause;new StartException(str, cause)
- Smart code suggestions by Codota
}
@Override public void failed(StartException reason) throws IllegalStateException { reason.printStackTrace(); startLatch.countDown(); }
@Override public void start(StartContext context) throws StartException { try { super.start(context); } catch (StartException e) { error = e; e.printStackTrace(); latch.countDown(); throw e; } catch (Throwable t) { error = t; latch.countDown(); throw new StartException(t); } }
protected static boolean awaitStability(long timeout, TimeUnit unit, Set<? super ServiceController<?>> failed, Set<? super ServiceController<?>> problem) throws InterruptedException { boolean stable = system.awaitStability(timeout, unit, failed, problem); if (!stable) { log.warn("awaitStability() may require an increased timeout duration."); } if (failed != null && !failed.isEmpty()) { Iterator<? super ServiceController<?>> failedIterator = failed.iterator(); while (failedIterator.hasNext()) { ServiceController controller = (ServiceController) failedIterator.next(); log.errorf(CONTROLLER_MESSAGE, controller.getName(), controller.getState(), controller.getSubstate(), controller.getMode()); if (controller.getStartException() != null) { controller.getStartException().printStackTrace(); } } } if (problem != null && !problem.isEmpty()) { Iterator<? super ServiceController<?>> problemIterator = problem.iterator(); while (problemIterator.hasNext()) { ServiceController controller = (ServiceController) problemIterator.next(); log.errorf(CONTROLLER_MESSAGE, controller.getName(), controller.getState(), controller.getSubstate(), controller.getMode()); if (controller.getStartException() != null) { controller.getStartException().printStackTrace(); } } } return stable; }