Configure the environment is: CentOS + Tomcat 7 8
A few days before the project reason need to deploy a war file, test whether can normal open,
But oddly, deploy Tomcat after every time manually shut down will be submitted to the following error:
[root @ localhost bin] #./shutdown. Sh
Using CATALINA_BASE:/root/apache tomcat -- 9.0.11
Using the CATALINA_HOME:/root/apache tomcat - 9.0.11
Using CATALINA_TMPDIR:/root/apache tomcat - 9.0.11/temp
Using JRE_HOME:/usr
Using the CLASSPATH:/root/apache tomcat - 9.0.11/bin/bootstrap jar:/root/apache tomcat - 9.0.11/bin/tomcat - juli. Jar
Aug 26, 2019 3:06:19 AM org. Apache. Catalina. Startup. Catalina the stopServer
SEVERE: Could not contact [localhost: [8005]]. Tomcat may not be running.
Aug 26, 2019 3:06:19 AM org. Apache. Catalina. Startup. Catalina the stopServer
SEVERE: Catalina. Stop:
Java.net.ConnectException: Connection refused (Connection refused)
The at java.net.PlainSocketImpl.socketConnect (Native Method)
At java.net.AbstractPlainSocketImpl.doConnect AbstractPlainSocketImpl. Java: (350)
At java.net.AbstractPlainSocketImpl.connectToAddress AbstractPlainSocketImpl. Java: (206)
At java.net.AbstractPlainSocketImpl.connect AbstractPlainSocketImpl. Java: (188)
At java.net.SocksSocketImpl.connect SocksSocketImpl. Java: (392)
At java.net.Socket.connect (589) Socket. Java:
At java.net.Socket.connect (538) Socket. Java:
The at java.net.Socket.
The at java.net.Socket.
The at org. Apache. Catalina. Startup. Catalina. The stopServer (catalina. Java: 498)
At sun. Reflect. NativeMethodAccessorImpl. Invoke0 (Native Method)
At sun. Reflect. NativeMethodAccessorImpl. Invoke (NativeMethodAccessorImpl. Java: 62)
At sun. Reflect. DelegatingMethodAccessorImpl. Invoke (43) DelegatingMethodAccessorImpl. Java:
The at Java. Lang. Reflect. Method. Invoke (498) Method. The Java:
The at org. Apache. Catalina. Startup. The Bootstrap. The stopServer (403) the Bootstrap. Java:
At org. Apache. Catalina. Startup. The Bootstrap. Main (497) the Bootstrap. Java:
[root @ localhost bin] #./shutdown. Sh
Using CATALINA_BASE:/root/apache tomcat -- 9.0.11
Using the CATALINA_HOME:/root/apache tomcat - 9.0.11
Using CATALINA_TMPDIR:/root/apache tomcat - 9.0.11/temp
Using JRE_HOME:/usr
Using the CLASSPATH:/root/apache tomcat - 9.0.11/bin/bootstrap jar:/root/apache tomcat - 9.0.11/bin/tomcat - juli. Jar
Aug 26, 2019 3:06:19 AM org. Apache. Catalina. Startup. Catalina the stopServer
SEVERE: Could not contact [localhost: [8005]]. Tomcat may not be running.
Aug 26, 2019 3:06:19 AM org. Apache. Catalina. Startup. Catalina the stopServer
SEVERE: Catalina. Stop:
Java.net.ConnectException: Connection refused (Connection refused)
The at java.net.PlainSocketImpl.socketConnect (Native Method)
At java.net.AbstractPlainSocketImpl.doConnect AbstractPlainSocketImpl. Java: (350)
At java.net.AbstractPlainSocketImpl.connectToAddress AbstractPlainSocketImpl. Java: (206)
At java.net.AbstractPlainSocketImpl.connect AbstractPlainSocketImpl. Java: (188)
At java.net.SocksSocketImpl.connect SocksSocketImpl. Java: (392)
At java.net.Socket.connect (589) Socket. Java:
At java.net.Socket.connect (538) Socket. Java:
The at java.net.Socket.
The at java.net.Socket.
The at org. Apache. Catalina. Startup. Catalina. The stopServer (catalina. Java: 498)
At sun. Reflect. NativeMethodAccessorImpl. Invoke0 (Native Method)
At sun. Reflect. NativeMethodAccessorImpl. Invoke (NativeMethodAccessorImpl. Java: 62)
At sun. Reflect. DelegatingMethodAccessorImpl. Invoke (43) DelegatingMethodAccessorImpl. Java:
The at Java. Lang. Reflect. Method. Invoke (498) Method. The Java:
The at org. Apache. Catalina. Startup. The Bootstrap. The stopServer (403) the Bootstrap. Java:
At org. Apache. Catalina. Startup. The Bootstrap. Main (497) the Bootstrap. Java:
And web page display "unable to access this web site
"
Can certain is that, before the deployment of war file, there is no question of Tomcat,
So I on the Internet to find solutions to find for a long time, most say it's because the port 8005 start too slow (when calculating the random number block)
. The solution is to modify the Java security, this file will be securerandom. The source of this changed to:
Securerandom. Source=file:/dev/./urandom
Good,
However I tried find still won't do...
So for this problem and made two days still didn't understand, depressed for a long time,
Until one day I put the virtual machine network adapter by NAT connection mode is changed to bridge mode and replicate physical network connection state,
The problem is solved
Now I am still a face of meng, so far all don't know why,