tomcat报Network is unreachable

    今天在虚拟机中新装了个redhat5.5版的,装好jdk和tomcat,但是在运行tomcat的时候却报了:
severe: protocol handler pause failedjava.net.socketexception: network is unreachable        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:529)        at java.net.socket.connect(socket.java:478)        at java.net.socket.<init>(socket.java:375)        at java.net.socket.<init>(socket.java:218)        at org.apache.jk.common.channelsocket.unlocksocket(channelsocket.java:486)        at org.apache.jk.common.channelsocket.pause(channelsocket.java:283)        at org.apache.jk.server.jkmain.pause(jkmain.java:681)        at org.apache.jk.server.jkcoyotehandler.pause(jkcoyotehandler.java:153)        at org.apache.catalina.connector.connector.pause(connector.java:1073)        at org.apache.catalina.core.standardservice.stop(standardservice.java:563)        at org.apache.catalina.core.standardserver.stop(standardserver.java:744)        at org.apache.catalina.startup.catalina.stop(catalina.java:628)        at org.apache.catalina.startup.catalina$catalinashutdownhook.run(catalina.java:671)sep 18, 2011 2:37:56 am org.apache.catalina.core.standardservice stop
 由于是linux新手,开始没有查出是什么原因,以为是tomcat没有配置好;但是看到<span style="color: #ff0000;">java.net.socketexception: network is unreachable</span>才知道原来是防火墙没有关,随后关掉防火墙之后,在windows下通过 http://192.168.56.128:8080/访问linux中的tomcat正常。
下面贴出linux下关闭防火墙的命令:
1) 重启后生效
开启: chkconfig iptables on
关闭: chkconfig iptables off <br>2) 即时生效,重启后失效 <br>开启: service iptables start <br>关闭: service iptables stop
 

你可能感兴趣的:(java,工作)