aspose file tools*
The moose likes Tomcat and the fly likes Socket bind failed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Socket bind failed" Watch "Socket bind failed" New topic
Author

Socket bind failed

Guy deLyonesse
Ranch Hand

Joined: Apr 12, 2011
Posts: 200

I know, seems simple, right?

If I run



I get no output. Good. So 8443 is NOT in use by any app.

So I start Tomcat.

SEVERE: Error starting endpoint
java.lang.Exception: Socket bind failed: [730048] Only one usage of each socket address (protocol/network address/port) is normally permitted.
at org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:649)
at org.apache.tomcat.util.net.AprEndpoint.start(AprEndpoint.java:756)
at org.apache.coyote.http11.Http11AprProtocol.start(Http11AprProtocol.java:137)
at org.apache.catalina.connector.Connector.start(Connector.java:1095)
at org.apache.catalina.core.StandardService.start(StandardService.java:540)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Dec 15, 2011 10:58:10 AM org.apache.catalina.core.StandardService start
SEVERE: Failed to start connector [Connector[HTTP/1.1-8443]]
LifecycleException: service.getName(): "Catalina"; Protocol handler start failed: java.lang.Exception: Socket bind failed: [730048] Only one usage of each socket address (protocol/network address/port) is normally permitted.
at org.apache.catalina.connector.Connector.start(Connector.java:1102)
at org.apache.catalina.core.StandardService.start(StandardService.java:540)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Dec 15, 2011 10:58:10 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 762 ms


And run



again and get this output:

TCP 0.0.0.0:8443 0.0.0.0:0 LISTENING 3608


My webapp times out when I try and run it.

So it seems like Tomcat is managing to listen on port 8443 but isn't actually binding it, so it's broken internally and times out when I do a request against it.

This is Windows 7 and Tomcat 6.

Any thoughts?

Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19722
    
  20

Also try ports 8080, 8005 and 8009. Tomcat uses several ports by default: 8080 for HTTP requests, 8443 for HTTPS requests, 8005 for shutting down and 8009 for AJP - for allowing other browsers like Apache HTTPD and IIS to redirect requests to Tomcat.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Guy deLyonesse
Ranch Hand

Joined: Apr 12, 2011
Posts: 200

Yeah those ports are all being successfully bound when Tomcat starts. It's only 8443 that has a problem.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16145
    
  21

If 8443 is available when Tomcat is down, and Tomcat says "only 1 user allowed", I'd look at the server.xml to see if 8443 is defined in more than one connector, causing Tomcat to attempt to set up 2 different listeners on port 8443.

8443 can be tricky, since in addition to specifying it as a primary (https) listening port, a number of other connectors get told to send secure requests to 8443. So not every reference to 8443 is a listener definition. It's only multiple listeners that you have to worry about.


Customer surveys are for companies who didn't pay proper attention to begin with.
Guy deLyonesse
Ranch Hand

Joined: Apr 12, 2011
Posts: 200

Yeah I was looking at that too. In the fresh Tomcat install the secure Connector is actually commented out, and uncommenting it is the only change I made to the file. Here it is:

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Socket bind failed