Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 314009 - 'BindException: Address already in use' when explicitly specifying jetty.xml configuration file on command line
Summary: 'BindException: Address already in use' when explicitly specifying jetty.xml ...
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: server (show other bugs)
Version: 7.1.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 7.0.2.RC0   Edit
Assignee: Joakim Erdfelt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-22 00:25 EDT by Michael Gorovoy CLA
Modified: 2010-05-25 19:12 EDT (History)
2 users (show)

See Also:


Attachments
Debug log of jetty startup (397.28 KB, application/octet-stream)
2010-05-22 00:25 EDT, Michael Gorovoy CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Gorovoy CLA 2010-05-22 00:25:50 EDT
Created attachment 169582 [details]
Debug log of jetty startup

When attempting to start the server using following command line to the following, 'BindException: Address already in use' is being thrown. A full log with DEBUG set to true is attached. This happens on both Mac OS X and Ubuntu 10.4 operating system.

java -jar start.jar etc/jetty.xml

###############################################################
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.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:208)
	at org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:288)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
	at org.eclipse.jetty.server.Server.doStart(Server.java:237)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
	at org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:1018)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:983)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.jetty.start.Main.invokeMain(Main.java:447)
	at org.eclipse.jetty.start.Main.start(Main.java:605)
	at org.eclipse.jetty.start.Main.parseCommandLine(Main.java:238)
	at org.eclipse.jetty.start.Main.main(Main.java:77)
Comment 1 Greg Wilkins CLA 2010-05-22 03:43:48 EDT
This is not a bug, but a change in the way that start.jar works.

The contents of start.ini are always put on the command line, so because jetty.xml is in start.ini, you are getting it specified twice, hence 2 connectors and the already in use exception.

If you want to run with additional xml's on the command line, you just need to specify the additional.   If you want to replace the args from start.ini, you can specify a --ini= argument that will replace the ini with a null ini.  So

  java -jar start.jar --ini= etc/jetty.xml 

works.

I'll update the readme and then restage the releases.
Comment 2 Michael Gorovoy CLA 2010-05-24 10:13:35 EDT
This is a welcome change, but it has to be announced prominently in the release notice once the release is promoted in order to reduce possibility of someone tripping up on it.

Also, this type of changes should be announced on the development list as soon as they are committed to eliminate extra cycles being spent by developers attempting to figure out what is going on.

-Michael
Comment 3 Jan Bartel CLA 2010-05-25 09:55:13 EDT
Actually I believe we need to change the jetty.sh script as it puts the jetty.xml file on the runline by default.

Jan
Comment 4 Jan Bartel CLA 2010-05-25 10:01:47 EDT
Re-assigning to Joakim to fix.

Jan
Comment 5 Joakim Erdfelt CLA 2010-05-25 19:12:29 EDT
The extra jetty.xml reference in jetty.sh has been removed.