1. 개요
- Tomcat 버그 : 61668 - Possible NullPointerException in org.apache.coyote.http11.AbstractHttp11Protocol
- 8.5.24 버전 및 9.0.2 이상에서 해결되었음
2. 원인
< org/apache/coyote/http11/AbstractHttp11Protocol >
public String getSslEnabledProtocols() {
registerDefaultSSLHostConfig();
return StringUtils.join(defaultSSLHostConfig.getEnabledProtocols());
}
public String getSSLProtocol() {
registerDefaultSSLHostConfig();
return StringUtils.join(defaultSSLHostConfig.getEnabledProtocols());
}
(8.5 기준으로) 8.5.23 이하 버전에서, 위에서 사용된 StringUtils.join 메소드의 문제임
public static String join(String[] array) {
return join(Arrays.asList(array));
}
3. 해결책
StringUtils.join 메소드가 개선되었음
< org/apache/tomcat/util/buf/StringUtils >
public static String join(String[] array) {
if (array == null) {
return EMPTY_STRING;
}
return join(Arrays.asList(array));
}