linux系统tomcat启动报端口被占用换端口一样 5C

启动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 :8090
at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:549)
at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:176)
at org.apache.catalina.connector.Connector.initialize(Connector.java:1049)
at org.apache.catalina.core.StandardService.initialize(StandardService.java:703)
at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:838)
at org.apache.catalina.startup.Catalina.load(Catalina.java:538)
at org.apache.catalina.startup.Catalina.load(Catalina.java:562)
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.load(Bootstrap.java:261)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.net.BindException: Address already in use
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:383)
at java.net.ServerSocket.bind(ServerSocket.java:328)
at java.net.ServerSocket.(ServerSocket.java:194)
at java.net.ServerSocket.(ServerSocket.java:150)
at org.apache.tomcat.util.net.DefaultServerSocketFactory.createSocket(DefaultServerSocketFactory.java:50)
at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:538)
... 12 more
2016-11-7 17:50:09 org.apache.catalina.core.StandardService initialize
严重: Failed to initialize connector [Connector[HTTP/1.1-8090]]
LifecycleException: Protocol handler initialization failed: java.net.BindException: Address already in use :8090
at org.apache.catalina.connector.Connector.initialize(Connector.java:1051)
at org.apache.catalina.core.StandardService.initialize(StandardService.java:703)
at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:838)
at org.apache.catalina.startup.Catalina.load(Catalina.java:538)
at org.apache.catalina.startup.Catalina.load(Catalina.java:562)
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.load(Bootstrap.java:261)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
2016-11-7 17:50:09 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 1691 ms
2016-11-7 17:50:09 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2016-11-7 17:50:09 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.35
2016-11-7 17:50:09 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deploying configuration descriptor host-manager.xml
2016-11-7 17:50:09 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deploying configuration descriptor manager.xml
2016-11-7 17:50:09 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory ROOT
2016-11-7 17:50:09 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory docs
2016-11-7 17:50:09 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory examples
2016-11-7 17:50:09 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory review
2016-11-7 17:50:09 org.apache.catalina.loader.WebappClassLoader validateJarFile
信息: validateJarFile(/usr/local/tomcat/webapps/review/WEB-INF/lib/javaee.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class

尝试将tomcat下conf文件中service的8080端口改为8090或者其他端口。但是没有效果,一直在报端口占用。
注:如果将电脑重启后第一次启动tomcat正常,但是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

注:只有在tomcat下部署项目时才会报错。如果只有tomcat的话不会报错

4个回答

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

u010337845
初学者01 但是再对tomcat进行shutdown 还是有这个进程
接近 3 年之前 回复
u010337845
初学者01 在tomcat shutdown后用ps-ef |grep tomcat 发现有一个进程没有结束掉。手动结束进程后对tomcat进行启动tomcat可以正常启动
接近 3 年之前 回复

楼上正解
www.diyerland.com

2.重启前查看tomcat进程还在不在
ps -ef |grep java
如果显示有tomcat,那么就代表没有shutdown成功

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进程号

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!