解压war文件异常
tomcat启动时解压war文件时抛出类似下方的异常时,检查war文件中是否存在以中文命名的目录或者文件,如存在则将中文命名的目录或文件夹修改为英文即可
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/devops]]
Caused by: java.lang.IllegalArgumentException: MALFORMED
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina]
//省略其他异常日志信息
Tomcat 启动过慢
tomcat一般启动时间都很快,但有时达到几分钟甚至更甚,修改bin/catalina.sh
文件,在文件头部增加下述参数,再此启动后tomcat速度就快了很多
JAVA_OPTS="-Djava.security.egd=file:/dev/./urandom"
客户端请求服务端异常
通过HttClient SSL工具请求服务端(Tomcat)异常
javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
1 修改conf/server.xml,增加sslEnabledProtocols,添加支持的SSL版本
<Connector port="443" sslEnabledProtocols="SSLv2Hello,TLSv1,TLSv1.1,TLSv1.2,SSL"/>
2 修改bin/catalina.sh文件,打开SSLL日志,通过日志信息调试获知SSL版本
JAVA_OPTS="-Djavax.net.debug=ssl"
Tomcat SSL protocol 异常
Tomcat启动时抛出如下异常
SEVERE: Failed to initialize end point associated with ProtocolHandler ["http-apr-443"]
java.lang.Exception: Connector attribute SSLCertificateFile must be defined when using SSL with APR
SEVERE: Failed to initialize connector [Connector[HTTP/1.1-443]]
org.apache.catalina.LifecycleException: Failed to initialize component [Connector[HTTP/1.1-443]]
Caused by: org.apache.catalina.LifecycleException: Protocol handler initialization failed
Caused by: java.lang.Exception: Connector attribute SSLCertificateFile must be defined when using SSL with APR
修改conf/server.xml,将protocol属性中的HTTP/1.1修改为Http11Protocol
<Connector port="443" protocol="org.apache.coyote.http11.Http11Protocol"/>