【问题标题】:Several ports required by Tomcat v7.0 Server at localhost are already in useTomcat v7.0 服务器在 localhost 所需的几个端口已在使用中
【发布时间】:2017-04-08 17:07:33
【问题描述】:

尝试更改端口,但错误仍然存​​在。 我们使用了仅安装了 java、tomcat 和 eclipse 的 Windows 2008、8.1、7 来隔离问题,但没有运气。 我们不知道从何处获取有关此错误的更多信息的日志。 我不是只是帮助我的同事的程序员。

下面的链接是 netstat 结果以及 server.xml 文件: https://drive.google.com/file/d/0B8s89SzGxv2Xclp3bllKTzloZ0E/view?usp=sharing

大家知道我们如何排除故障并知道具体问题吗?

【问题讨论】:

  • 查看这里以了解您的 Tomcat 尝试使用的端口:mkyong.com/tomcat/how-to-change-tomcat-default-port
  • 也许你正在并行启动两个tomcat?一个来自 Eclipse,另一个来自控制台?如果你这样做,当你启动第二个 tomcat 时,这些端口显然已经在使用中了。
  • @NiklasP 或者另一个Tomcat仍在后台运行。
  • @Niklas 我们没有安装 tomcat。我们将 eclipse 指向位于驱动器 C(根目录)的 tomcat zip 文件。我还确保执行 shutdown.bat 只是为了确保没有运行任何 tomcat。

标签: java eclipse tomcat7


【解决方案1】:

你可以根据需要在tomcat中更改或添加新端口。

编辑位于 conf 文件夹中的 server.xml 文件。

<Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />

<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
               maxThreads="150" SSLEnabled="true">
        <SSLHostConfig>
            <Certificate certificateKeystoreFile="conf/localhost-rsa.jks"
                         type="RSA" />
        </SSLHostConfig>
</Connector>

<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

【讨论】:

  • 我想我们已经这样做了。你能确认我在谷歌驱动器上共享的文件吗?
猜你喜欢
  • 2022-01-03
  • 2011-10-05
  • 2023-03-19
  • 2017-06-30
  • 1970-01-01
  • 2012-01-22
  • 2014-07-14
  • 1970-01-01
相关资源
最近更新 更多