Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Jetty on MAC OS X(FAILED SelectChannelConnector@0.0.0.0:8080: java.net.BindException: Address already in use)
Jetty on MAC OS X [message #1052874] Tue, 30 April 2013 16:48 Go to next message
George Goglidze is currently offline George Goglidze
Messages: 1
Registered: April 2013
Junior Member
I have a project which is done with jetty 8
and it works fine when run on Windows.

But when I run it on MAC OS X 10.8.3 I get the following error:
869 [main] WARN org.eclipse.jetty.util.component.AbstractLifeCycle - FAILED SelectChannelConnector@0.0.0.0:8080: java.net.BindException: Address already in use



This is not the problem of permissions, as I have tried to run it with "sudo" and it gives the same result.

Here is the code:

Server server = new Server(port);
SelectChannelConnector connector = new SelectChannelConnector();
connector.setPort(port);
connector.setThreadPool(new QueuedThreadPool(200));
server.addConnector(connector);

ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
context.setContextPath("/");

context.addServlet(new ServletHolder(new ImageServlet()), "/img/*");

context.addServlet(new ServletHolder(new OtherServlet()), "/other/*");


context.addServlet(new ServletHolder(new webConfigMainMenuHandler(0,0)), web_rootFolder + "");
context.addServlet(new ServletHolder(new webConfigMainMenuHandler(0,0)), web_rootFolder + "/main.html");


context.setErrorHandler(createErrorHandler());

server.setHandler(context);

server.start();


the exception comes on the server.start();

Please let me know how to fix this.

Many thanks,
Re: Jetty on MAC OS X [message #1052931 is a reply to message #1052874] Wed, 01 May 2013 09:14 Go to previous message
Russell Bateman is currently offline Russell Bateman
Messages: 3146
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 5/1/2013 6:43 AM, George Goglidze wrote:
> I have a project which is done with jetty 8
> and it works fine when run on Windows.
>
> But when I run it on MAC OS X 10.8.3 I get the following error:
> 869 [main] WARN org.eclipse.jetty.util.component.AbstractLifeCycle -
> FAILED mailto:SelectChannelConnector@0.0.0.0:8080:
> java.net.BindException: Address already in use
>
>
>
> This is not the problem of permissions, as I have tried to run it with
> "sudo" and it gives the same result.
>
> Here is the code:
>
> Server server = new Server(port);
> SelectChannelConnector connector = new
> SelectChannelConnector();
> connector.setPort(port);
> connector.setThreadPool(new QueuedThreadPool(200));
> server.addConnector(connector);
>
> ServletContextHandler context = new
> ServletContextHandler(ServletContextHandler.SESSIONS);
> context.setContextPath("/");
>
> context.addServlet(new ServletHolder(new ImageServlet()),
> "/img/*");
>
> context.addServlet(new ServletHolder(new OtherServlet()),
> "/other/*");
>
>
> context.addServlet(new ServletHolder(new
> webConfigMainMenuHandler(0,0)), web_rootFolder + "");
> context.addServlet(new ServletHolder(new
> webConfigMainMenuHandler(0,0)), web_rootFolder + "/main.html");
>
>
> context.setErrorHandler(createErrorHandler());
>
> server.setHandler(context);
>
> server.start();
>
>
> the exception comes on the server.start();
>
> Please let me know how to fix this.
>
> Many thanks,

No, it's not a permissions problem. You simply already have a process
running on your host using port 8080. You can a) find and shut down that
service or b) modify Jetty to use a different port.

In my case, for instance, I double-click the Tomcat server in my Servers
view which gives me access to (Tomcat's) settings. I change my port to
[admin:8005, HTTP:8000, AJP:8009]. I'm sure Jetty gives you analogous
control over it.

Hope this helps.
Previous Topic:Eclipse Freezing on Windows 7/64 bit
Next Topic:Can Eclipse run on the Chromebook (Chrubuntu)?
Goto Forum:
  


Current Time: Thu Aug 21 00:22:52 EDT 2014

Powered by FUDForum. Page generated in 0.03112 seconds