0
votes

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 [email protected]: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?

1
Seems this is problem with of using same port twice. Can you cross check ? - Suresh Atta
"shut down both processes" is this action successful ? - Vinay Veluri
Maybe this helps. - Jens
@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
try to kill the server port check this link: stackoverflow.com/questions/6204003/… - tokhi

1 Answers

0
votes

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.