내가 다음과 같습니다 톰캣 포함하는 코드가이 실행되면서버를 시작할 때 Tomcat이 커넥터를 시작하지 않는 이유는 무엇입니까?
public void start()
{
final Tomcat tomcat = createTomcat();
try
{
tomcat.start();
}
catch (Exception e)
{
throw new RuntimeException("Failed to start web server", e);
}
this.tomcat = tomcat;
}
private Tomcat createTomcat()
{
Tomcat tomcat = new Tomcat();
tomcat.setBaseDir(FileUtils.getTempDirectory().getAbsolutePath());
tomcat.setConnector(createConnector());
// ... eliding the webapp, session, access log setup ...
return tomcat;
}
private Connector createConnector()
{
Connector connector = new Connector();
connector.setPort(context.getWebServerPort());
connector.setScheme("https");
connector.setSecure(true);
//prepareKeyStore(context.getListeningHost());
connector.setAttribute("address", context.getListeningAddress());
connector.setAttribute("SSLEnabled", true);
// Bind on start() instead of init() so that the port is closed faster on shutdown
// I still have another problem where stop() seems to return before shutdown is
// truly complete!
connector.setAttribute("bindOnInit", false);
connector.setAttribute("keystoreFile", "/my/keystore");
connector.setAttribute("keystorePass", "password");
connector.setAttribute("clientAuth", "false");
connector.setAttribute("sslProtocol", "TLS");
connector.setAttribute("keyAlias", context.getListeningHost());
connector.setAttribute("keyPass", "password");
return connector;
}
을, Tomcat은 모든 포트에서 수신 대기 시작되지 않습니다. 나는 주변을 샅샅이 조사하고 커넥터가 여전히 NEW 상태에 있음을 발견했습니다.
톰캣 자체를 시작할 때 톰캣이 시작하지 않는 이유는 무엇입니까?
stop() 및 destroy()에서도 마찬가지입니다. 그들 중 누구도 그것을 부르지 않는 것처럼 보입니다.
나중에 오류가 발생하지 않으며 나중에 tomcat.getConnector().start()
을 호출하면 성공하고 서비스를 연결할 수있는 것으로 보입니다.