简体   繁体   中英

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

I start a project by using gradle, tomcat and eclipse. I have already the files, but I want to open it on Eclipse.

For it, in the repertory of work, i make the command "gradle build" and "gradle eclipse" and it works.

But, when I make "gradle jettyRunWar", I have the following error:

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

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':jettyRunWar'.

    Could not start the Jetty server.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 13.71 secs

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
gradle jettyRunWar

it will be able to start the jetty server
now the Question is how to kill the process at 8080 in windows. To do that run the following command for windows 7

FOR /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.
in your build.gradle file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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