Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] Jetty server - java.net.BindException: Address already in use (on MAC OS X)

Hi,

I should have mentioned earlier…

No services are running on that port… I'm trying to use port 8080… and nothing shows up with the command: 
netstat -an | grep 8080

Thanks,


On 1 May 2013, at 13:51, Jesse McConnell <jesse.mcconnell@xxxxxxxxx> wrote:

you have something else running on that port on your mac

One of the startup services that you can enable for personal file sharing brings up an apache server on that port, or you could have something else installed on there that you started up.  I have my file sharing enabled so I typically start jetty up on port 9090.

to see what is on there right now, navigate your browser to http://localhost:8080

Also, this would have been more appropriate for jetty-users list but not a huge deal

cheers,
jesse

--
jesse mcconnell
jesse.mcconnell@xxxxxxxxx


On Wed, May 1, 2013 at 7:42 AM, George Goglidze <george@xxxxxxxxxxxx> wrote:
Hi all,

This is my first post in this mailing list. and I am sorry if I have chosen a wrong one. 
Please if so, direct me to the correct mailing list and I'll post there.

I have written a java application, which is using embedded jetty server.
It runs just fine on Windows system, but does not run on MAC OS X 10.8.3 (mountain lion).

It gives me the following exception:
891  [main] WARN  org.eclipse.jetty.util.component.AbstractLifeCycle  - FAILED SelectChannelConnector@0.0.0.0:8080: java.net.BindException: Address already in use

I have the following 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("/");

// ERROR 404
context.addServlet(new ServletHolder(new HttpDefaultHandler()),"/*");


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

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


// WEB COMPONENT
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 is given on the last line: server.start()

I have already tried to run this using "sudo". So it's not permissions problem. 

Many thanks for your help,

George,

_______________________________________________
jetty-dev mailing list
jetty-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-dev


_______________________________________________
jetty-dev mailing list
jetty-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-dev


Back to the top