[Newbie] "java.net.SocketException: Invalid argument" when running devmode

3,513 views
Skip to first unread message

Chihab Otmani

unread,
Mar 21, 2010, 5:58:06 PM3/21/10
to Google Web Toolkit
Hi all,

I've got the following errors when running the development mode code
server as described in this tutorial: http://code.google.com/webtoolkit/doc/latest/tutorial/create.html,
either using eclipse or webAppcreator ant.

When using Eclipse, the following message is displayed in the
console :
"Could not connect to remote UI listening at localhost:52134. Using
default UI instead."
The GWT development Mode window is displayed. According to the Web
Server tab, AppEngine seems to be started. The Development mode tab
shows a Communications error -- exception SocketException the detailed
trace is :

java.net.SocketException: Invalid argument
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:
67)
at
com.google.gwt.dev.DevModeBase.ensureCodeServerListener(DevModeBase.java:
898)
at com.google.gwt.dev.DevModeBase.doStartup(DevModeBase.java:888)
at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1030)
at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:783)
at com.google.gwt.dev.DevMode.main(DevMode.java:275)


When using webAppCreator (from the GWT eclipse plugin installation
folder) and then "ant devmode" to test, I've got:
devmode:
[java] Unable to start embedded HTTP server
[java] java.net.SocketException: Invalid argument
[java] at sun.nio.ch.Net.bind(Native Method)
[java] at
sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:
119)
[java] at
sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:
59)
[java] at
org.mortbay.jetty.nio.SelectChannelConnector.open(SelectChannelConnector.java:
205)
[java] at
org.mortbay.jetty.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:
304)
[java] at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:
39)
[java] at org.mortbay.jetty.Server.doStart(Server.java:
233)
[java] at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:
39)
[java] at
com.google.gwt.dev.shell.jetty.JettyLauncher.start(JettyLauncher.java:
543)
[java] at
com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:
421)
[java] at
com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:
1035)
[java] at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:
783)
[java] at com.google.gwt.dev.DevMode.main(DevMode.java:275)

Do you have an idea where these errors come from ?

My environment:
* Eclipse Galileo 3.5.2 with Java EE IDE Feature 1.2.2
* Google App Engine Java SDK 1.3.1
* Google Plugin for Eclipse 1.3.1
* Google Web Toolkit SDK 2.0.3
* Debian Testing amd64, Linux 2.6.32
* Java version "1.6.0_16" (Java HotSpot(TM) 64-Bit Server VM (build
14.2-b01, mixed mode))
* Apache Ant version 1.8.0

Thanks !

Jason Parekh

unread,
Mar 22, 2010, 10:30:05 AM3/22/10
to google-we...@googlegroups.com
Hi Chihab,

It looks like there are general issues with your configuration when listening on sockets.

Given you're on Linux, I can't imagine it to be permission issues.  Have you tried rebooting?  Do you know if any of your other apps successfully listen on a port?  Could you try a quick Java sample to listen on a port?  For example http://java.sun.com/docs/books/tutorial/networking/sockets/clientServer.html .

jason


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.


Jason Parekh

unread,
Mar 22, 2010, 11:58:54 AM3/22/10
to google-we...@googlegroups.com
Hi Chihab,

Rajeev brought up a good point.  It could potentially be an IPV6 issue with Sun's sockets. You could try seting the networking property:

java.net.preferIPv4Stack=true

as documented here:

Chihab Otmani

unread,
Mar 22, 2010, 1:15:36 PM3/22/10
to Google Web Toolkit
I've actually set up this property on my eclipse.ini because otherwise
I can't download GWT plugin on Eclipse.

I can successfully start Jetty (installed from debian repository) and
also other java services so it doesn't seem to be a socket listening
issue. Maybe, the issue is do to the way eclipse's jetty is
configured...
I'll try tonight to figure out where it comes from.

Thanks for your indications

Chihab

On Mar 22, 4:58 pm, Jason Parekh <jasonpar...@gmail.com> wrote:
> Hi Chihab,
>
> Rajeev brought up a good point.  It could potentially be an IPV6 issue with
> Sun's sockets. You could try seting the networking property:
> java.net.preferIPv4Stack=true
> as documented here:http://java.sun.com/j2se/1.4.2/docs/guide/net/ipv6_guide/index.htmljason
>

> On Mon, Mar 22, 2010 at 10:30 AM, Jason Parekh <jasonpar...@gmail.com>wrote:
>
>
>
> > Hi Chihab,
>
> > It looks like there are general issues with your configuration when
> > listening on sockets.
>
> > Given you're on Linux, I can't imagine it to be permission issues.  Have
> > you tried rebooting?  Do you know if any of your other apps successfully
> > listen on a port?  Could you try a quick Java sample to listen on a port?
> >  For example

> >http://java.sun.com/docs/books/tutorial/networking/sockets/clientServ....

> >> google-web-tool...@googlegroups.com<google-web-toolkit%2Bunsubs cr...@googlegroups.com>

Chihab Otmani

unread,
Mar 23, 2010, 6:16:40 AM3/23/10
to Google Web Toolkit
It seems to be an IPV6 issue. By seting the networking property
"java.net.preferIPv4Stack=true" as jvm argument, jetty server starts
successfully.
I did this by adding the property to the jvm arguments on the devmode
ant target.
On eclipse, I added the property to jvm arguments on the StockWatcher
Run configuration.

Thanks for your help.

Reply all
Reply to author
Forward
0 new messages