-----Problem-----
When trying to start CAS Server 1.x the following "java.net.BindException: Address already in use: bind" error is thrown in the CAS log and the CAS Server will not start: 

09-06-01 10:46:59 INFO Endeca CAS Server 1.1.0.184062 (Main)
09-06-01 10:46:59 INFO Starting server on port 9999 with workspace directory F:\Apps\myapp\data\my_file_crawl\workspace (Main)
09-06-01 10:47:07 WARN failed SelectChannelConnector@0.0.0.0:9999 (NativeMethodAccessorImpl)
java.net.BindException: Address already in use: bind
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.mortbay.jetty.nio.SelectChannelConnector.open(SelectChannelConnector.java:211)
at org.mortbay.jetty.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:309)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at org.mortbay.jetty.Server.doStart(Server.java:228)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine.addServant(JettyHTTPServerEngine.java:244)
at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.activate(JettyHTTPDestination.java:143)
at org.apache.cxf.transport.AbstractObservable.setMessageObserver(AbstractObservable.java:47)
at org.apache.cxf.binding.AbstractBindingFactory.addListener(AbstractBindingFactory.java:166)
at org.apache.cxf.binding.soap.SoapBindingFactory.addListener(SoapBindingFactory.java:617)
at org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:121)
at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:122)
at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:147)
at com.endeca.itl.cxf.impl.Server.start(Server.java:70)
at com.endeca.itl.Main.main(Main.java:85)
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:585)
at com.endeca.itl.MainRunner.main(MainRunner.java:46)
09-06-01 10:47:07 WARN failed Server@5449ff3f (NativeMethodAccessorImpl)
java.net.BindException: Address already in use: bind
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.mortbay.jetty.nio.SelectChannelConnector.open(SelectChannelConnector.java:211)
at org.mortbay.jetty.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:309)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at org.mortbay.jetty.Server.doStart(Server.java:228)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine.addServant(JettyHTTPServerEngine.java:244)
at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.activate(JettyHTTPDestination.java:143)
at org.apache.cxf.transport.AbstractObservable.setMessageObserver(AbstractObservable.java:47)
at org.apache.cxf.binding.AbstractBindingFactory.addListener(AbstractBindingFactory.java:166)
at org.apache.cxf.binding.soap.SoapBindingFactory.addListener(SoapBindingFactory.java:617)
at org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:121)
at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:122)
at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:147)
at com.endeca.itl.cxf.impl.Server.start(Server.java:70)
at com.endeca.itl.Main.main(Main.java:85)
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:585)
at com.endeca.itl.MainRunner.main(MainRunner.java:46)
09-06-01 10:47:07 ERROR START_UP_SERVER_FAILED_MSG (JettyHTTPServerEngine)
09-06-01 10:47:07 INFO Server ready on port 9999 (Server)
09-06-01 10:47:07 INFO Shutting down the server (Server)
09-06-01 10:47:07 INFO Server shutdown complete (Server)

-----Cause-----
This will happen whenever the CAS Server port is already in use by a different process, and also if the CAS Console has been configured to use the same port as the CAS Server. The CAS Console's "on-line help" uses a separate port from the CAS Server called "casconsole.infocenter.port" per the %ENDECA_CONF%\conf\Standalone\localhost\casconsole.xml file.

-----Solution-----
Ensure that no other process is using the CAS Server port via a utility like netstat and ensure that the casconsole.infocenter.port is configured to use a different port from the CAS Server. If you must change the casconsole.infocenter.port, you must restart the Tomcat instance that it is running in for the change to take affect.


+ Recent posts