0

I've recently started using Super Dev Mode, and am launching the server and codeserver using the maven gwt plugin.

First I do "mvn:gwt-run" to start the regular dev mode server, then I run "mvn:run-codeserver" to run the codeserver. It works fine when I go to localhost:8888 and press the "Dev Mode On" bookmarklet. The problem I have is when I terminate both launches and then start them again.

I get this error when running the codeserver for the second time:

[ERROR] 2014-07-21 14:12:12.176:INFO:oejs.Server:jetty-8.y.z-SNAPSHOT
[ERROR] 2014-07-21 14:12:12.198:WARN:oejuc.AbstractLifeCycle:FAILED SelectChannelConnector@127.0.0.1:9876: java.net.BindException: Address already in use: bind
[ERROR] java.net.BindException: Address already in use: bind
[ERROR]     at sun.nio.ch.Net.bind0(Native Method)
[ERROR]     at sun.nio.ch.Net.bind(Net.java:444)
[ERROR]     at sun.nio.ch.Net.bind(Net.java:436)
[ERROR]     at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
[ERROR]     at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
[ERROR]     at org.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:187)
[INFO] [ERROR] [ERROR] cannot start web server

The only way of fixing the issue is to quit eclipse, terminate the java.exe process that is still running (and using ~2gb of memory) and then start eclipse again.

Is this a known error or is there something I'm not doing right?

slugmandrew
  • 1,776
  • 2
  • 25
  • 45
  • Seems this is problem with of using same port twice. Can you cross check ? – Suresh Atta Jul 21 '14 at 13:29
  • "shut down both processes" is this action successful ? – Vinay Veluri Jul 21 '14 at 13:31
  • Maybe [this](https://groups.google.com/forum/#!topic/codehaus-mojo-gwt-maven-plugin-users/IXg7iFTCS0o) helps. – Jens Jul 21 '14 at 13:32
  • @VinayVeluri I probably should have said "Terminate both launches" instead. I shut down dev mode by closing the `GWT Development Mode` window that is open, then I press the red square (stop button) in the console tab in eclipse to stop the code server. It seems that this does not close the port though. – slugmandrew Jul 21 '14 at 13:35
  • @Jens I found that, but it doesn't seem they have resolved the issue in that thread, unless I'm missing something? Also I think like Thomas Broyer I am using an eclipse run configuration to launch with `gwt:run-codeserver` as the goal. – slugmandrew Jul 21 '14 at 13:37
  • @tokhi No, Windows 7. – slugmandrew Jul 21 '14 at 14:00
  • 1
    try to kill the server port check this link: http://stackoverflow.com/questions/6204003/kill-a-process-by-looking-up-the-port-being-used-by-it-from-a-bat – tokhi Jul 21 '14 at 14:09

1 Answers1

0

Just adding the answer I came up with, as taken from this question:

I open cmd.exe and paste in:

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

That usually echoes out a single port that is blocked by codeserver on port 9876. Then I take out the @ECHO and run this to actually kill it:

FOR /F "tokens=5 delims= " %P IN ('netstat -a -n -o ^| findstr :9876') DO TaskKill.exe /PID %P /T /F

More info explaining how it works on the original answer.

Community
  • 1
  • 1
slugmandrew
  • 1,776
  • 2
  • 25
  • 45