I’m very pleased to report I’ve just had my first positive experience developing with Red5!
It seems like a lot of my problems could have been caused by the fact that the Red5 Plugin simply doesn’t work with version 0.7 of the server.
I’ve been advised by the main man himself to download and install version 0.8 RC1 of Red5 and try again, but unfortunately I initially tried to install this version and it failed. So instead I was advised to downloaded the Tarball version, un-tar it, create a Red5 directory in Program Files and copy the contents over. I assume that because I haven’t gone through the install procedure it makes sense that Red5 doesn’t show up in Add/Remove Programs or in Services anymore.
So the next step was to try and recreate the server within Eclipse and publish it. On doing so I was confronted with this QuickTime related error:
Starting Red5 (org.red5.server.Shutdown)
java.lang.NoClassDefFoundError: Files\Java\jre1/6/0_07\lib\ext\QTJava/zip
Caused by: java.lang.ClassNotFoundException: Files\Java\jre1.6.0_07\lib\ext\QTJava.zip
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
Exception in thread "main"
I was actually quite pleased to see this error as I hadn’t seen it before and felt like I might be making progress. After a quick Google I found this thread on the Red5 mailing list by a user with a similar problem. As with the JAVA_HOME issue, this was again to do with Environment Variables. I checked my CLASSPATH var as instructed in the response to the thread (right-click My Computer/Properties/Advanced/Environment Variables), and bizarrely it was set to:
.;C:\Program Files\Java\jre1.6.0_07\lib\ext\QTJava.zip
The first thing I noticed was that for some reason this string starts with the characters “.;”, which really didn’t look right, so I deleted those characters, logged off and back on to reset my environment vars and tried again. No joy. Next I tried adding quotation marks to the string as suggested and the error went away.
BUT… then I was confronted with another error…
Starting Red5 (org.red5.server.Shutdown)
Attempting to connect to RMI port: 9999
java.io.IOException: Failed to retrieve RMIServer stub: ...
So I Googled the first few lines of the error again, only to be confronted with 5 results, two of which were my own blog. So it appears I’m back to the point I’d reached before when I gave up on publishing the server from Eclipse or creating the application code automatically with the plugin, and started playing with simple examples that had been published on a mac. As you can imagine I was quite disappointed by this point.
Wondering what to do next, I thought I’d just try running the server by double clicking the red5.bat in Program Files/Red5. This opened a DOS prompt and started the server successfully as you would expect. I then thought I’d just try connecting my previous Mac published example to the server to see if it works. It worked. Ok… so the next problem I was having was the weird caching behaviour. So I stopped the server by closing the DOS prompt, changed a little bit of the Java code in the tutorial, published the files by cleaning the server within Eclipse (as mentioned before this is a good way to auto deploy to the server even if you can’t get the server running in eclipse), restarted the server from the red5.bat file and ran the Flex client code within Eclipse. The changes had taken effect..! I tried it 3 or 4 more times just to make sure and it continued to work!
My next question then was if that’s started to work.. maybe the server and client side code generated by the Red5 Eclipse Plugin would now work too..? So I created a new Red5 project with auto generated code, and went through the same deployment method as above. IT WORKED..!
Still skeptical, I tried changing and republishing the code several times just to see if the changes would take effect. IT STILL WORKED!!! I NOW HAVE A WORKING HELLO WORLD EXAMPLE!!!
Its been a bit of a battle, but I’m now elated to report I’ve reached the point where I can actually start writing Red5 applications! I also have to say that I feel fairly smug about the fact that the problems I was having weren’t down to simple errors of my own making (unless you consider my not knowing that v0.2 of the plug-in targets Red5 server v0.8 an error of my own making, but I don’t remember seeing any mention of that via the path I took to the plugin). I notice the new home of the plugin does clearly offer two versions though for 0.8 or 0.7 or below, which is cool.
The plugin still doesn’t work exactly as it’s supposed to (i.e. I can’t actually publish the server), so if anyone has any suggestions on how to get it fully functional I’d be very happy to hear them. In the meantime though I can now start creating my own Red5 apps!
Big thanks to the lovely guys at Red5 for their continued support which has brought me to this point. Although I’ve never had such a battle getting something working, I’ve also never had such generous offers of support from such senior members of a team. By way of recompense my next post will be a condensed guide for Java novice PC users hoping to setup Red5 to steer them through all of the pitfalls I fell into. After that I’ll start recreating my simple FMS examples with Red5 equivalent code. Can’t wait!
December 2, 2008 at 8:17 pm |
Congratulations Rob !
“Red5plugin on windows : A New Hope”
I am going to start developping red5 app too
December 2, 2008 at 8:31 pm |
haha thanks Jérôme!
cheers for your input too, that Mac tute really helped.
December 5, 2008 at 8:42 am |
hell of a program. Thanks fot he tip about QTJava (i had as well)…but it is still not running i keep having the current error when launching red5.bat
about java.net.URLClassLoader$1, a java dev told me it can be abou the jre wich can be too old…but since i have the last one (jre6) whith red5 0.8…i don’t understand…i ‘ll keep watching this….
I have a question thought (maybe it is because i m french i don’t understand the whole thing about the red5 plug in … i guess this plug in (i couldn t use yet ;() is made for developping a client side project….isn’t it? is it a problem if i develop a client side project on a computer and the red5 server is running on another?
cheers
December 5, 2008 at 8:43 am |
…excellent blog by the way, few documentation can be found about red5, so thank you
December 5, 2008 at 9:38 am |
Thanks gropapa, nice to here its been of some use.
The plug-in has the ability to automatically create demo client and server side code for you, and can also run the server from within Eclipse. If you haven’t tried auto generating the code yet I’d really recommend you give that a go, you should be able to create both your client and server side code for your project within the same workspace in Eclipse.
January 2, 2009 at 12:10 pm |
hi rob,
i’m roopesh. its my fresh experience to red5, actually i installed red5 latest SVN on centos. it starts the service and running.
But if i try to run the sample application which is given in red5 itself i’m getting connection failed error.
please give suggestion, where i was wrong. Please mail me the instructions