0.025
thk thk Wed. 21 Oct. 2009 22:11 tags linux , programming , pc 0 views
Ok , this is a  bug I ve been struggling long time to solve.
My red5 server was getting about 5(!) minutes to start on my live virtual server.
On home it takes about 15-20 seconds.
So as java is a very advanced language and when you make a change in your code you have to restart the whole universe, this was a stop-stop situation for me since I wanted to upload a new red5 application on my server and restarting took so much time (this also meant that while restarting red5 we could not execute the marvelous radio application , and maybe the radio would stop playing).

As with all problems you start by trying to erase and replace the whole thing. But this thing rarely works , instead it gives you more trouble . So it happened .I checked out red5 sources from svn ,but the trunk version made a lot more time to come up (maybe because of the bug i discovered after?? who knows (i am not so geek)) .
And then by wandering in internet i discovered these 2 pages that helped me resolve the problem.
1  ,  2 .
Take a good look at number 2. My problem is very slow startup and at logs it stuck when enabling the JMX and RMI. At log you stuck on a line like those:

2009-10-21 21:45:53,067 [main] INFO  org.red5.server.jmx.JMXAgent - JMX HTML adapter was not enabled
2009-10-21 21:45:53,097 [main] INFO  org.red5.server.jmx.JMXAgent - RMI Registry server was not found on port 9999


This is normal but on my case I was stuck there for 3 minutes in each case.
So.

Take a good look at this link above.

JMX resolves names in a messy and unreliable way : http://java.sun.com/j2se/1.4.2/docs/guide/rmi/faq.html#nethostname In a nutshell it's returning "localhost" (or possibly directly 127.0.0.1 - try "hostname -i" on your machine) to JConsole as the name of ther server so follow on calls resolve to the wrong machine.

In a virtual server (my case again) when it restarts,  the hostname  gets screwed in a non-existent hostname.
try to set it again with
sudo hostname <a real hostname>
and then red5 will magically start fast again.