Here’s a wierd one – Address already in use

Today I encounterd a strange error-

I started the ArcGIS Manager Service to use the Restful Services Directory and to my surprise it did not work. I have installed ArcGIS Server 9.3.1 for a few weeks now and was working fine.

I tried the following url’s:

http://localhost:8399/arcgis/rest – restful services direcoty – did not work

http://localhost:8399/arcgis/services?wsdl – services catalog soap end point – did not work

http://localhost:8399 – directory listing of  “C:\Program Files\ArcGIS\java\web_output” – did not work

Wearing my trouble shooting hat, I checked the log files at location: “C:\Program Files\ArcGIS\java\manager\service\logs

1. manager_stderr.txt – did not indicate any issues

2. managerappserver0.log – here I found the following error:

Jun 3, 2009 12:46:00 PM org.apache.catalina.core.StandardServer await
SEVERE: StandardServer.await: create[8300]:
java.net.BindException: Address already in use: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
at java.net.ServerSocket.bind(ServerSocket.java:319)
at java.net.ServerSocket.(ServerSocket.java:185)
at org.apache.catalina.core.StandardServer.await(StandardServer.java:346)
at org.apache.catalina.startup.Catalina.await(Catalina.java:600)
at org.apache.catalina.startup.Catalina.start(Catalina.java:560)
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 org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)

The error message indicates that port 8300 was blocked/taken in my machine.

The cuplrit was the Aptana IDE which was open and the port 8300 was used up.

Digging deeper: Aptana IDE is bundled with the Jaxer support. Jaxer Console for internal Jaxer Server uses a free port between 8300-8500. It so happened that Since ArcGIS Server Manager was not yet started when I opened Aptana IDE, it used the 8300. So the order matters. Could’nt find a simple way to change the port range within Aptana. This could be fodder for a different post.

Incase you are wondering why is ArcGIS Server Manager using port 8300 (the well known ports are 8399 and 8099) then the answer is here “C:\Program Files\ArcGIS\java\manager\service\tomcat\managerappserver\conf\server.xml”. The manager appserver (tomcat) uses port 8300 as shutdown port. And yes, you can edit shutdown port from 8300 to 8299 (or any other unique port)  and restart the ArcGIS Server Manager service.

Easier Solution would be to close Aptana IDE. Restart ArcGIS Server Manager (manager.exe) service and then open Aptana IDE.

Voila, all back to normal … back to work now …

Let me know if anyone else had the same issue.

Note: This post is not applicable to ArcGIS Server .Net

Advertisements

One Response to “Here’s a wierd one – Address already in use”

  1. jamal Says:

    This is most common error when two or more connections had started in same time or the existing connection is in use has been closed upnormally yes you are right just restart the server or stop its acivities from services.msc from run command.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: