Export to GitHub

google-web-toolkit - issue #4312

stopping and restarting web app leaves socket open


Posted on Dec 7, 2009 by Happy Wombat

GWT 2.0RC2, FF 3.5, Eclipse 3.5, Google Plugin for Eclipse 3.5 1.1.101.v200911250703

Detailed description (please be as specific as possible):

The stop button doesn't seem to completely stop the web app. Hitting the stop button, then running the web app for the second time results in

[ERROR] Unable to bind socket on port 9997 -- is another session active? java.net.BindException: Address already in use at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:365) at java.net.ServerSocket.bind(ServerSocket.java:319) at java.net.ServerSocket.bind(ServerSocket.java:277) at com.google.gwt.dev.shell.BrowserListener.<init>(BrowserListener.java:81) at com.google.gwt.dev.DevModeBase.ensureCodeServerListener(DevModeBase.java:80 2) at com.google.gwt.dev.DevModeBase.doStartup(DevModeBase.java:792) at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:933) at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:690) at com.google.gwt.dev.DevMode.main(DevMode.java:251) Initializing AppEngine server

...

Dec 7, 2009 6:39:09 PM com.google.apphosting.utils.jetty.JettyLogger warn WARNING: failed SelectChannelConnector@0.0.0.0:8888 java.net.BindException: Address already in use at sun.nio.ch.Net.bind(Native Method) at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:119) at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59) at org.mortbay.jetty.nio.SelectChannelConnector.open(SelectChannelConnector.ja va:211) at org.mortbay.jetty.nio.SelectChannelConnector.doStart(SelectChannelConnector .java:309) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at org.mortbay.jetty.Server.doStart(Server.java:228) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40) at com.google.appengine.tools.development.JettyContainerService.startContainer (JettyContainerService.java:181) at com.google.appengine.tools.development.AbstractContainerService.startup(Abs tractContainerService.java:116) at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerI mpl.java:217) at com.google.appengine.tools.development.gwt.AppEngineLauncher.start(AppEngin eLauncher.java:86) at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:375) at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:938) at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:690) at com.google.gwt.dev.DevMode.main(DevMode.java:251) Dec 7, 2009 6:39:09 PM com.google.apphosting.utils.jetty.JettyLogger warn WARNING: failed Server@293bdd36

Workaround if you have one:

Quit and restart Eclipse

Comment #1

Posted on Dec 15, 2009 by Helpful Ox

(No comment was entered for this change.)

Comment #2

Posted on Dec 15, 2009 by Swift Camel

Even after you have exited all browser connections, the code server is still running waiting for new connections. You need to stop that connection from your previous launch before starting another one. Also, note that you don't necessarily have to restart it at all -- just make your changes and refresh the browser or launch a new browser.

@Miguel: I believe this is the same confusion I had -- it simply isn't readily noticeable that you have a code server running from a previous launch in GPE.

Comment #3

Posted on Dec 16, 2009 by Happy Wombat

The error happens when you

1) close the browser window/tab for the web application. 2) hit the stop button in eclipse

I agree that this isn't the optimal way of using the product. It is a valid use case though. The problem with the use case is that it results in a really annoying workaround/penalty if you happen to do it. The error is also not necessarily obvious, so the key word from the previous comment is 'confusion', which shouldn't happen.

Comment #4

Posted on Dec 16, 2009 by Helpful Lion

 I was not able to reproduce this problem using GWT 2.0, FF 3.0.3, Google Plugin for Eclipse 3.5 version 1.2 on OSX.

I launch a web app, hit it from firefox, close firefox and stop the launch configuration.

@rdayal: can you reproduce this?

Comment #5

Posted on Dec 16, 2009 by Happy Wombat

In the initial bug report I forgot to indicate that I'm using Linux/Fedora

Comment #6

Posted on Dec 18, 2009 by Happy Dog

@mmendez: I'll try and see if I can repro this.

@darrellpf: As a test, try waiting 30 seconds from the time that you hit the STOP button to actually restarting the application. Do you still run into the problem?

Comment #7

Posted on Dec 18, 2009 by Happy Wombat

When I attempted the test, it failed. I waited 10 minutes. When I went to run it again I noticed that the 'stop' button (and the others) had disappeared from the task bar strip next to the development mode tab. After quitting and restarting eclipse everything is working flawlessly. I haven't made any changes to eclipse or the plugins.

I have the same problem reproduced and sitting on my work machine. I'll spend some time with it early next week to see if I can isolate the problem.

Comment #8

Posted on Dec 18, 2009 by Happy Dog

@darrellpf: I was unable to reproduce this on Ubuntu. Let me know what else you find out. Take a look at your Error Log and see if there is anything interesting in there (Window -> Show View -> Error Log)

Comment #9

Posted on Dec 18, 2009 by Happy Dog

(No comment was entered for this change.)

Comment #10

Posted on Dec 18, 2009 by Happy Dog

@darrellpf: Also, I've been testing with GPE 1.2.0 (as opposed to RC2). You may want to upgrade to GPE 1.2.0 and retry.

Comment #11

Posted on Dec 21, 2009 by Happy Wombat

I've tried this on another machine that also had the problem. I'm no longer able to reproduce it there either.

Please close this as an RC2 problem.

Comment #12

Posted on Dec 22, 2009 by Happy Dog

This does not seem to be a problem in the final release.

Comment #13

Posted on Jun 16, 2010 by Quick Rhino

I Still get the same problem

[ERROR] Unable to bind socket on port 9997 -- is another session active? java.net.BindException: Address already in use at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:336) at java.net.ServerSocket.bind(ServerSocket.java:336) at java.net.ServerSocket.bind(ServerSocket.java:294) at com.google.gwt.dev.shell.BrowserListener.(BrowserListener.java:66) at com.google.gwt.dev.DevModeBase.ensureCodeServerListener(DevModeBase.java:914) at com.google.gwt.dev.DevModeBase.doStartup(DevModeBase.java:904) at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1049) at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:804) at com.google.gwt.dev.DevMode.main(DevMode.java:279)

There is no browser open and also under the development tab I get this address

http://127.0.0.1:8888/test.html?gwt.codesvr=127.0.0.1:-1

Comment #14

Posted on Jun 21, 2010 by Happy Dog

@juliocastme: Are you sure that all no other GWT-related processes are running? If you switch over to the Debug perspective, do you see any other GWT processes running?

Comment #15

Posted on Aug 6, 2010 by Massive Bird

This happens to me occasionally too. (Ubuntu, GWT 2.04)

If I close Eclipse/Firefox and kill the Java process it fixes it.

Comment #16

Posted on Jan 12, 2012 by Massive Panda

I still get this at GWT 2.0.3 ...
The restart button usually fails 2 to 3 times per hour .. Then I have to totally stop everything.... wait for a min and rerun it.

Status: CannotReproduce

Labels:
Category-EclipsePlugin Type-Defect Priority-Critical