Linux下tomcat启动报错:portalreadyinuse


导致该问题的原因很多,标题说明不了具体问题。

在此仅说下我的操作,遇到的问题及其解决方法,希望能起到抛砖引玉的作用。

启动tomcat,报错如下:

Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 7800; nested exception is:
java.net.BindException: Address already in use

检查了${TOMCAT_HOME}/conf/server.xml,context.xml,web.xml等配置文件,未发现配置7800端口的地方。

于是google搜索,一篇文章给了我提示:https://bowerstudios.com/node/636

于是从 ${TOMCAT_HOME}/bin/catalina.sh 启动文件中找到了答案。

JAVA_OPTS="-server -Xms2048m -Xmx2048m -XX:PermSize=512m -XX:MaxPermSize=512m -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.pwd.file=/opt/app/appcode/jmxremote.password -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=7803"
分析了一下,因为tomcat不是由我配置,本人仅维护而已,从而不能全部掌握安装人员的配置精髓。

相关内容