配置tomcat的时候 发现了一个问题,tomcat启动的时候,8005端口未启动,故无法关闭tomcat,后经查询解决了,记录一下子
tomcat启动的时候看不出异常,关闭的时候回报错类似:
Jul 17, 2015 9:47:54 AM org.apache.catalina.startup.Catalina stopServer
SEVERE: Could not contact localhost:8005. Tomcat may not be running.
Jul 17, 2015 9:47:54 AM org.apache.catalina.startup.Catalina stopServer
SEVERE: Catalina.stop:
Java.NET.ConnectException: Connection timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.Net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:525)
at java.net.Socket.connect(Socket.java:475)
at java.net.Socket.(Socket.java:372)
at java.net.Socket.(Socket.java:186)
at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:498)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:370)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:457)
即为8005端口未运行,使用命令netstat -ant 发现 没有找到8005端口
解决办法:
修改$JAVA_HOME/jre/lib/security/Java.security 文件中 securerandom.source 配置项:
将
securerandom.source=file:/dev/random
修改为:
securerandom.source=file:/dev/urandom