看代碼有助于線上出現(xiàn)預(yù)料之外的事的時(shí)候,不至于心慌。。。
StandardEngine[Tomcat].StandardHost[localhost]的啟動(dòng)與StandardEngine不在同一個(gè)線程中,它的start:
// Start our child containers, if any Container children[] = findChildren(); List<Future<Void>> results = new ArrayList<>(); for (int i = 0; i < children.length; i++) { results.add(startStopExecutor.submit(new StartChild(children[i]))); } boolean fail = false; for (Future<Void> result : results) { try { result.get(); } catch (Exception e) { log.error(sm.getString("containerBase.threadedStartFailed"), e); fail = true; } &nb