简体   繁体   English

在Ubuntu上,命令“ gradle jettyRunWar”不起作用

[英]The command “gradle jettyRunWar” doesn t work, on Ubuntu

I start a project by using gradle, tomcat and eclipse. 我使用gradle,tomcat和eclipse启动了一个项目。 I have already the files, but I want to open it on Eclipse. 我已经有了文件,但是我想在Eclipse上打开它。

For it, in the repertory of work, i make the command "gradle build" and "gradle eclipse" and it works. 为此,在工作清单中,我使命令“ gradle build”和“ gradle eclipse”有效。

But, when I make "gradle jettyRunWar", I have the following error: 但是,当我制作“ gradle jettyRunWar”时,出现以下错误:

failed SelectChannelConnector@0.0.0.0:8080: java.net.BindException: Adresse déjà utilisée failed Server@ad6443: java.net.BindException: Adresse déjà utilisée :jettyRunWar FAILED 失败的SelectChannelConnector@0.0.0.0:8080:java.net.BindException:地址失败Server @ ad6443:java.net.BindException:地址失败:jettyRunWar失败

FAILURE: Build failed with an exception. 失败:构建失败,发生异常。

  • What went wrong: Execution failed for task ':jettyRunWar'. 出了什么问题:任务':jettyRunWar'的执行失败。

    Could not start the Jetty server. 无法启动Jetty服务器。

  • Try: Run with --stacktrace option to get the stack trace. 尝试:使用--stacktrace选项运行以获取堆栈跟踪。 Run with --info or --debug option to get more log output. 使用--info或--debug选项运行以获取更多日志输出。

BUILD FAILED 建立失败

Total time: 13.71 secs 总时间:13.71秒

How to solve it ? 怎么解决呢?

Thanks 谢谢

well there are two solutions 好,有两种解决方案
1>> if you kill the process running on that port ie 8080 and than run the 1 >>如果您终止在该端口(即8080)上运行的进程,然后运行
gradle jettyRunWar 摇篮码头

it will be able to start the jetty server 它将能够启动码头服务器
now the Question is how to kill the process at 8080 in windows. 现在的问题是如何在Windows 8080中终止该进程。 To do that run the following command for windows 7 为此,请针对Windows 7运行以下命令

FOR /F "tokens=5 delims= " %P IN ('netstat -a -n -o ^| findstr :8080') DO @ECHO TaskKill.exe /F /PID %P 对于/ F“ tokens = 5 delims =”%P IN('netstat -a -n -o ^ | findstr:8080')DO @ECHO TaskKill.exe / F / PID%P

2>> you should ask gradle to assign some other port for jetty server that can be done by writing httpPort=9090 //whichever port number you want to run it on. 2 >>,您应该要求gradle为Jetty服务器分配其他端口,这可以通过写入httpPort = 9090 //要在其上运行的任何端口号来完成。
in your build.gradle file. 在您的build.gradle文件中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM