linux系统tomcat启动报端口被占用, 解决方法

阅读 820 发表时间 2017-02-15 12:35:16
linux tomcat
启动tomcat后日志报错
2016-11-7 17:50:08 org.apache.catalina.core.AprLifecycleListener init
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/jdk1.6.0_45/jre/lib/i386/client:/usr/java/jdk1.6.0_45/jre/lib/i386:/usr/java/jdk1.6.0_45/jre/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib
2016-11-7 17:50:09 org.apache.coyote.http11.Http11Protocol init
严重: Error initializing endpoint

java.net.BindException: Address already in use :8080


1.重启前有没shutdown操作?
2.重启前查看tomcat进程还在不在
ps -ef |grep java
如果显示有tomcat,那么就代表没有shutdown成功
3.启动前可以查看端口是否被占用
netstat -an|grep 8080
如果有显示被占用,则表明有程序在用8080端口号,根据你的描述可以判断你之前启动的tomcat进程还在。


tomcat shutdown后用ps -ef|grep tomcat后正在运行进程
/usr/java/jdk1.6.0_45/bin/java -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/local/tomcat/endorsed -classpath /usr/local/tomcat/bin/bootstrap.jar -Dcatalina.base=/usr/local/tomcat -Dcatalina.home=/usr/local/tomcat -Djava.io.tmpdir=/usr/local/tomcat/temp org.apache.catalina.startup.Bootstrap start


如果进程还在的话,可以使用kill命令,将这个进程kill掉
kill -9 tomcat进程号

0个回复
有思考的问答, 才是有价值的问答, 否则将无任何记录价值.
关注极客云图了解更多内容