CENTOS 7 中报错 java.net.ConnectException Connection
【摘要】 再centos7 中正常启动tomcat 9,但是发现项目都不能正常访问,去关闭tomcat 却报错,如下:[root@localhost ~]# /opt/apache-tomcat-9.0.0.M22/bin/shutdown.sh Using CATALINA_BASE: /opt/apache-tomcat-9.0.0.M22Using CATALINA_HOME: /opt...
再centos7
中正常启动tomcat 9
,但是发现项目都不能正常访问,去关闭tomcat 却报错,如下:
[root@localhost ~]# /opt/apache-tomcat-9.0.0.M22/bin/shutdown.sh
Using CATALINA_BASE: /opt/apache-tomcat-9.0.0.M22
Using CATALINA_HOME: /opt/apache-tomcat-9.0.0.M22
Using CATALINA_TMPDIR: /opt/apache-tomcat-9.0.0.M22/temp
Using JRE_HOME: /opt/jdk1.8.0_131/jre
Using CLASSPATH: /opt/apache-tomcat-9.0.0.M22/bin/bootstrap.jar:/opt/apache-tomcat-9.0.0.M22/bin/tomcat-juli.jar
十月 12, 2017 7:08:00 下午 org.apache.catalina.startup.Catalina stopServer
严重: Could not contact [localhost:[8005]]. Tomcat may not be running.
十月 12, 2017 7:08:00 下午 org.apache.catalina.startup.Catalina stopServer
严重: Catalina.stop:
java.net.ConnectException: 拒绝连接 (Connection refused)
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(Socket.java:589)
at java.net.Socket.connect(Socket.java:538)
at java.net.Socket.<init>(Socket.java:434)
at java.net.Socket.<init>(Socket.java:211)
at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:478)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:408)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:497)
发现这种奇怪的问题,去检查端口,发现根本没有tomcat进程的端口:
[root@localhost bin]# netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22122 0.0.0.0:* LISTEN 63455/fdfs_trackerd
tcp 0 0 0.0.0.0:3690 0.0.0.0:* LISTEN 2855/svnserve
tcp 0 0 0.0.0.0:6379 0.0.0.0:* LISTEN 127481/redis-server
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1396/sshd
tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 183014/postgres
tcp 0 0 0.0.0.0:23000 0.0.0.0:* LISTEN 64278/fdfs_storaged
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2229/master
tcp 0 0 0.0.0.0:8001 0.0.0.0:* LISTEN 98427/mosquitto
tcp 0 0 0.0.0.0:8002 0.0.0.0:* LISTEN 72040/nginx: master
tcp 0 0 0.0.0.0:8004 0.0.0.0:* LISTEN 109896/vsftpd
tcp6 0 0 :::8009 :::* LISTEN 104964/java
tcp6 0 0 :::6379 :::* LISTEN 127481/redis-server
tcp6 0 0 :::22 :::* LISTEN 1396/sshd
tcp6 0 0 :::5432 :::* LISTEN 183014/postgres
tcp6 0 0 ::1:25 :::* LISTEN 2229/master
tcp6 0 0 :::8001 :::* LISTEN 98427/mosquitto
tcp6 0 0 127.0.0.1:8005 :::* LISTEN 104964/java
只好重新启动但是,还是启动后,还是没成功访问到项目,日志里也看不到什么多余的错误信息。
只好把项目删除了,再去启动tomcat,启动成功后,再去把war 包丢进webapps中,发现项目居然能成功访问,搞半天,没搞明白,估计还是项目有点问题,不能正常启动,直接把tomcat 弄死了。先记录下,以后有时间深入了解下。。
启动:
[root@localhost bin]# startup.sh
Using CATALINA_BASE: /opt/apache-tomcat-9.0.0.M22
Using CATALINA_HOME: /opt/apache-tomcat-9.0.0.M22
Using CATALINA_TMPDIR: /opt/apache-tomcat-9.0.0.M22/temp
Using JRE_HOME: /opt/jdk1.8.0_131/jre
Using CLASSPATH: /opt/apache-tomcat-9.0.0.M22/bin/bootstrap.jar:/opt/apache-tomcat-9.0.0.M22/bin/tomcat-juli.jar
Tomcat started.
监视端口进程:
[root@localhost bin]# netstat -tnlp|grep 8000
tcp6 0 0 :::8000 :::* LISTEN 104964/java
【版权声明】本文为华为云社区用户原创内容,未经允许不得转载,如需转载请自行联系原作者进行授权。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)