0

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

TotorAndMimine
  • 75
  • 1
  • 10
  • Have you tried to run with the --stacktrace/--debug option as suggested by gradle? – fge Nov 26 '15 at 21:22
  • "Adresse déjà utilisée" is "Address already in use". You have a process running & blocking that port. find & kill it. – zapl Nov 26 '15 at 21:26
  • No, I have never heard of this. How to do it ? (Sorry if my questions may be stupid, i am a beginner for this) – TotorAndMimine Nov 26 '15 at 21:27
  • zapl -> Which process (number) ? If I kill it, the problem will be solved ? – TotorAndMimine Nov 26 '15 at 21:28
  • run `netstat -ltp`, look for port 8080 or `http-alt`. If it doesn't appear run with `sudo`. The pid is listed in the end. e.g. `12959/java`. And in case it's java, run `jps` to see which application that is. Maybe you did run your code already? And in case you don't want to kill that process, you can probably change the port of the server – zapl Nov 26 '15 at 21:31
  • I see nothing on 8080, absolutely nothing... – TotorAndMimine Nov 26 '15 at 21:36

1 Answers1

0

well there are two solutions
1>> if you kill the process running on that port i.e 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.

H S Rathore
  • 1,954
  • 2
  • 15
  • 20
  • Sorry my bad didn't read that you are on UBUNTU. For How to kill a process on a port on ubuntu... follow the link [link](http://stackoverflow.com/questions/9346211/how-to-kill-a-process-on-a-port-on-ubuntu) – H S Rathore Mar 19 '16 at 14:46
  • It'll help someone facing issues in Windows environment. – H S Rathore Mar 25 '17 at 04:21