【问题标题】:automatic deployment of a web project using eclipse maven and tomcat使用eclipse maven和tomcat自动部署web项目
【发布时间】:2015-04-29 06:37:45
【问题描述】:

我按照简单的步骤来实现这一点。将 Tomcat 和 Maven 与 eclipse 集成。 1.打开日食。新建->其他-> maven项目-> webapp 2. 增加tomcat插件。 3.右键单击POM文件并以maven clean运行 4.作为maven运行生成源 5.作为maven构建运行。 6.通过命令tomcat:run 但是出现以下错误,

[ERROR] Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:run (default-cli) on project simplehelloworld: Could not start Tomcat: Protocol handler initialization failed: java.net.BindException: Address already in use: JVM_Bind <null>:8080 -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

【问题讨论】:

标签: java eclipse maven tomcat


【解决方案1】:
Could not start Tomcat: Protocol handler initialization failed: java.net.BindException: Address already in use: JVM_Bind <null>:8080 

上面的错误表示8080端口已经有服务在运行。是否有tomcat服务器已经在运行?

如果在 8080 上运行任何服务,则关闭它,或者您需要将 server.xml 中的连接器配置更改为如下所示:

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

你可以找到这个端口是否已经被使用,参考this链接。

【讨论】:

  • 我检查了端口,但没有运行。
  • 你试过mvn tomcat:deploy吗?注意 :- 使用 tomcat 7 :- mvn tomcat7:deploy 可能是 eclipse 持有该端口,如果您确定该端口未被任何其他应用程序使用,您可以尝试重新启动 eclipse
  • 并尝试使用另一个端口。我认为您可以更清楚地了解问题。
猜你喜欢
  • 2011-02-22
  • 2014-10-07
  • 1970-01-01
  • 2012-04-16
  • 1970-01-01
  • 2016-03-02
  • 2012-07-04
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多