Source:
<code>public synchronized void init(HiveConf hiveConf) { if (getServiceState() == STATE.NOTINITED) { conf = hiveConf; conf.setVar(HiveConf.ConfVars.HIVE_SESSION_IMPL_CLASSNAME, GrillSessionImpl.class.getCanonicalName()); cliService = new CLIService(); addService(cliService); addService(new EventServiceImpl(GrillEventService.NAME)); addService(new MetricsServiceImpl(MetricsService.NAME)); String[] serviceNames = conf.getStrings(GrillConfConstants.GRILL_SERVICE_NAMES); for (String sName : serviceNames) { try { Class<? extends GrillService> serviceClass = conf.getClass( GrillConfConstants.getServiceImplConfKey(sName), null, GrillService.class); LOG.info("Adding " + sName + " service with " + serviceClass); Constructor<?> constructor = serviceClass.getConstructor(CLIService.class); GrillService service = (GrillService) constructor.newInstance(new Object[] {cliService}); addService(service); grillServices.add(service); } catch (Exception e) { LOG.warn("Could not add service:" + sName, e); throw new WebApplicationException(e); } } for (Service svc : getServices()) { services.put(svc.getName(), svc); } super.init(conf); String persistPathStr = conf.get(GrillConfConstants.GRILL_SERVER_PERSIST_LOCATION, GrillConfConstants.DEFAULT_GRILL_SERVER_PERSIST_LOCATION); persistDir = new Path(persistPathStr); try { setupPersistedState(); } catch (Exception e) { LOG.error("Could not setup persisted state", e); <START> throw new WebApplicationException(e); <END> } LOG.info("Initialized grill services: " + services.keySet().toString()); } }</code><technical_language>Instead of throwing WebApplicationException exit JVM? WebApplicationException effect of client request, server startup itself</technical_language>

Target:
public synchronized void init(HiveConf hiveConf) { if (getServiceState() == STATE.NOTINITED) { conf = hiveConf; conf.setVar(HiveConf.ConfVars.HIVE_SESSION_IMPL_CLASSNAME, GrillSessionImpl.class.getCanonicalName()); cliService = new CLIService(); addService(cliService); addService(new EventServiceImpl(GrillEventService.NAME)); addService(new MetricsServiceImpl(MetricsService.NAME)); String[] serviceNames = conf.getStrings(GrillConfConstants.GRILL_SERVICE_NAMES); for (String sName : serviceNames) { try { Class<? extends GrillService> serviceClass = conf.getClass( GrillConfConstants.getServiceImplConfKey(sName), null, GrillService.class); LOG.info("Adding " + sName + " service with " + serviceClass); Constructor<?> constructor = serviceClass.getConstructor(CLIService.class); GrillService service = (GrillService) constructor.newInstance(new Object[] {cliService}); addService(service); grillServices.add(service); } catch (Exception e) { LOG.warn("Could not add service:" + sName, e); throw new RuntimeException("Could not add service:" + sName, e); } } for (Service svc : getServices()) { services.put(svc.getName(), svc); } super.init(conf); String persistPathStr = conf.get(GrillConfConstants.GRILL_SERVER_PERSIST_LOCATION, GrillConfConstants.DEFAULT_GRILL_SERVER_PERSIST_LOCATION); persistDir = new Path(persistPathStr); try { setupPersistedState(); } catch (Exception e) { LOG.error("Could not recover from persisted state", e); throw new RuntimeException("Could not recover from persisted state", e); } LOG.info("Initialized grill services: " + services.keySet().toString()); } }