Tuesday, August 19, 2008

Weird glassfish error

I was experimenting with Glassfish today and encountered this error:
[#|2008-08-20T01:59:37.128+0000|SEVERE|sun-appserver9.1|javax.enterprise.system.core|_ThreadID=11;_ThreadName=main;_RequestID=8db54f8d-759a-446b-96d2-1c8856d01776;|CORE5071: An error occured during initialization
com.sun.appserv.server.ServerLifecycleException: Cannot bind to URL [rmi://0.0.232.95:5586/management/rmi-jmx-connector]: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: Exception creating connection to: 0.0.232.95; nested exception is:
java.net.SocketException: Invalid argument or cannot assign requested address]|#]

Look at the server name: 0.0.232.95
That was strange. Upon investigation it turned out that my server name is 59487. This kind of numerical host names are typically assigned to the servers in hosted environments. If you write this number in hex then it becomes: E85F
Now somehow it gets converted in a 4 byte number and then that number is treated as an IP address. So here is what happens:
E85F--> 0000E85F---> 00.00.E8.5F --> 00.00.232.95

Mystery solved.

1 comment:

OOOps said...

You can use hostname command to change the hostname to resolve this problem. You might have to edit the /etc/hosts file to resolve the newly assigned name.