When I run mvn site:run it fails to start Jetty with an error "Unable
to establish loopback connection"

Google isn't helping me locate what the problem is.
>From what I can tell there are no firewalls blocking this running locally.
And it has worked at least once.

It has been a while since I have touched this project (probably when
we were using mvn 2.x)
I don't think this is a mvn 3.0.4 issue.

>mvn -DskipLocators -DskipTemplates site:run -Dport=9999
[INFO] --- maven-site-plugin:3.1:run
...
[INFO] Starting Jetty on http://localhost:9999/
2012-10-25 09:41:55.623:INFO::jetty-6.1.25
2012-10-25 09:41:55.732:INFO::NO JSP Support for /, did not find
org.apache.jasper.servlet.JspServlet
2012-10-25 09:41:56.871:WARN::failed
org.mortbay.jetty.nio.SelectChannelConnector$1@8ff4f3:
java.io.IOException: Unable to establish loopback connection
2012-10-25 09:41:56.871:WARN::failed
SelectChannelConnector@0.0.0.0:9999: java.io.IOException: Unable to
establish loopback connection
2012-10-25 09:41:56.871:WARN::failed Server@11a9253:
java.io.IOException: Unable to establish loopback connection
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE

-X gives me a strack trace

Caused by: org.apache.maven.plugin.MojoExecutionException: Error
executing Jetty: Unable to establish loopback connection
        at 
org.apache.maven.plugins.site.SiteRunMojo.execute(SiteRunMojo.java:108)
        at 
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
        at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
        ... 19 more
Caused by: java.io.IOException: Unable to establish loopback connection
        at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:125)
        at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:69)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.nio.ch.PipeImpl.<init>(PipeImpl.java:141)
        at 
sun.nio.ch.SelectorProviderImpl.openPipe(SelectorProviderImpl.java:50)
        at java.nio.channels.Pipe.open(Pipe.java:150)
        at sun.nio.ch.WindowsSelectorImpl.<init>(WindowsSelectorImpl.java:126)
        at 
sun.nio.ch.WindowsSelectorProvider.openSelector(WindowsSelectorProvider.java:44)
        at java.nio.channels.Selector.open(Selector.java:227)
        at 
org.mortbay.io.nio.SelectorManager$SelectSet.<init>(SelectorManager.java:313)
        at org.mortbay.io.nio.SelectorManager.doStart(SelectorManager.java:224)
        at 
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
        at 
org.mortbay.jetty.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:314)
        at 
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
        at org.mortbay.jetty.Server.doStart(Server.java:235)
        at 
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
        at 
org.apache.maven.plugins.site.SiteRunMojo.execute(SiteRunMojo.java:104)
        ... 21 more
Caused by: java.net.ConnectException: Connection refused: connect
        at sun.nio.ch.Net.connect0(Native Method)
        at sun.nio.ch.Net.connect(Net.java:364)
        at sun.nio.ch.Net.connect(Net.java:356)
        at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:623)
        at java.nio.channels.SocketChannel.open(SocketChannel.java:184)
        at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:97)
        ... 37 more

So what else has changed, I've been on leave for a while :)
Ahh, changed from java 1.6.0_32 to java 1.7.0_07.

Re-running under java 6 and everything is fine.

Now google can help me
https://www.google.com.au/search?q="Unable+to+establish+loopback+connection"+java+7
Top responses 
http://stackoverflow.com/questions/8367226/eclipse-failed-to-initialize-monitor-thread-unable-to-establish-loopback-conne
says to add the jvm argument -Djava.net.preferIPv4Stack=true

Running again with
>mvn -Djava.net.preferIPv4Stack=true -DskipLocators -DskipTemplates site:run 
>-Dport=9999
And it works.

Will start another thread about asking to bake in preferIPv4Stack.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to