<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Carl Sziebert &#187; Eclipse</title>
	<atom:link href="http://sziebert.net/posts/category/eclipse/feed/" rel="self" type="application/rss+xml" />
	<link>http://sziebert.net</link>
	<description>is a software engineer with an interest in Spring, Hibernate, Red5 and jQuery development.</description>
	<lastBuildDate>Thu, 29 Jul 2010 20:25:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Remote debugging Red5 applications</title>
		<link>http://sziebert.net/posts/remote-debugging-red5-applications/</link>
		<comments>http://sziebert.net/posts/remote-debugging-red5-applications/#comments</comments>
		<pubDate>Sun, 16 Sep 2007 19:53:34 +0000</pubDate>
		<dc:creator>Carl Sziebert</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Red5]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://sziebert.net/posts/remote-debugging-red5-applications/</guid>
		<description><![CDATA[<p>Red5<a class="sup" href="#red5">[1]</a> contributor <a href="http://osflash.org/paulgregoire">Paul Gregoire</a> recently added a new server startup script targeted specifically at application debugging.  The script is quite simple in nature and is provided in both Windows and Unix flavors.  Take note, however, that this script is exclusive to the standalone version of Red5.  Debugging the WAR version of the server is quite a different task.  To demonstrate the ease of debugging your applications, I&#8217;ll walk through a simple example using Eclipse<a class="sup" href="#eclipse">[2]</a> and the source code from my <a href="http://sziebert.net/posts/server-side-stream-recording-with-red5/">stream recording tutorial</a>.<!--more--> </p>
<p>First things first, you&#8217;ll want to make sure you have the latest code from Red5&#8242;s subversion repository.  If you do not run against trunk, fear not, you&#8217;ll just need to create the scripts manually.  Both versions are shown here:</p>
<p><strong>Windows</strong></p>
<pre class="brush: bash;">
@echo off

set JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y

if not &quot;%JAVA_HOME%&quot; == &quot;&quot; goto launchRed5

:launchRed5
&quot;%JAVA_HOME%/bin/java&quot; -Djava.security.manager -Djava.security.policy=conf/red5.policy %JAVA_OPTS% -cp red5.jar;conf;bin;%CLASSPATH% org.red5.server.Standalone
goto finaly

:err
echo JAVA_HOME environment variable not set! Take a look at the readme.
pause

:finaly
pause
</pre>
<p><strong>Unix</strong></p>
<pre class="brush: bash;">
#!/bin/bash

JAVA_OPTS=&quot;-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y&quot;

for JAVA in &quot;$JAVA_HOME/bin/java&quot; &quot;/usr/bin/java&quot; &quot;/usr/local/bin/java&quot;
do
  if [ -x $JAVA ]
  then
    break
  fi
done

if [ ! -x $JAVA ]
then
  echo &quot;Unable to locate java. Please set JAVA_HOME environment variable.&quot;
  exit
fi

# start red5
exec $JAVA -Djava.security.manager -Djava.security.policy=conf/red5.policy $JAVA_OPTS -cp red5.jar:conf:$CLASSPATH org.red5.server.Standalone
</pre>
<p>Make sure you&#8217;ve got the file permissions set correctly on Unix platforms.  If not, updating the file permissions is as simple as <tt>chmod 755 red5_debug.sh</tt>.  Double check to insure that your application is installed in the Red5 webapps directory and configured properly.  If not, you&#8217;ll need to deploy it now.  Start the server from the console.  Don&#8217;t expect to see the normal server log statements just yet.  The only statement we are interested in at this point is &#8220;<tt>Listening for transport dt_socket at address: 8787</tt>&#8220;.  You should be seeing something like this:</p>
<p><a href="http://sziebert.net/images/console-waiting.gif" rel="lightbox-debugging" title="Console"><img src="http://sziebert.net/images/thumbs/console-waiting.jpg" alt="Console" /></a></p>
<p>Next, we&#8217;ll need to create a debugging profile in Eclipse.  Start it now if it is not already running and make sure that your project is open in the workspace.  Mine looks something like this:</p>
<p><a href="http://sziebert.net/images/eclipse.gif" rel="lightbox-debugging" title="Eclipse"><img src="http://sziebert.net/images/thumbs/eclipse.jpg" alt="Eclipse" /></a></p>
<p>Find the small bug icon in the Eclipse toolbar, click it and choose &#8220;<tt>Open Debug Dialog...</tt>&#8220;.  Select the &#8220;<tt>Remote Java Application</tt>&#8221; entry in the list, then right click and choose &#8220;<tt>New</tt>&#8220;.  By default, Eclipse will name this debugging profile after the class you currently have selected in the editor.  I&#8217;ve changed it to reflect the name of the project I&#8217;m working with at the moment.  The only other changes we need to make are to alter the default port number from 8000 to 8787 and check the &#8220;<tt>Allow termination of remote VM</tt>&#8221; box.  The second step here is not really necessary, but I like having the option to kill the remote server from Eclipse.  Here&#8217;s what you should have:</p>
<p><a href="http://sziebert.net/images/debug-dialog.gif" rel="lightbox-debugging" title="Debug Dialog"><img src="http://sziebert.net/images/thumbs/debug-dialog.jpg" alt="Debug Dialog" /></a></p>
<p>Click &#8220;<tt>Apply</tt>&#8220;, then &#8220;<tt>Debug</tt>&#8220;.  Eclipse has now attached a socket listener to the remote JVM and Red5 should be starting in the console window you opened earlier, complete with all of the standard logging output shown here:</p>
<p><a href="http://sziebert.net/images/console-started.gif" rel="lightbox-debugging" title="Console"><img src="http://sziebert.net/images/thumbs/console-started.jpg" alt="Console" /></a></p>
<p>If you&#8217;ve never opened the debugging perspective in Eclipse before, it should prompt you to do so.  If not, select &#8220;<tt>Window --> Open Perspective --> Debug</tt>&#8220;.  Select the line at which you would like to set a breakpoint and double click in the gutter.  The debug perspective should have appeared and you should see your breakpoint:</p>
<p><a href="http://sziebert.net/images/eclipse-debug.gif" rel="lightbox-debugging" title="Eclipse Debug Perspecive"><img src="http://sziebert.net/images/thumbs/eclipse-debug.jpg" alt="Eclipse Debug Perspecive" /></a></p>
<p>At this point you&#8217;ll need to start the execution path of your application.  Fire up your flash or flex app and connect to Red5.  For this example, I&#8217;ve opened a browser and pointed it at the broadcast SWF of my stream recording tutorial.  Given that you are using the same project I am, you should see this (Sans my ugly mug, of course.):    </p>
<p><a href="http://sziebert.net/images/broadcast.jpg" rel="lightbox-debugging" title="Broadcast Flash App"><img src="http://sziebert.net/images/thumbs/broadcast.jpg" alt="Broadcast Flash App" /></a></p>
<p>Upon triggering your breakpoint, your application will cease to respond and Eclipse should come into focus.  The debugger will highlight the line of code next in the execution tree.  You&#8217;ll see something like the following:</p>
<p><a href="http://sziebert.net/images/eclipse-breakpoint.gif" rel="lightbox-debugging" title="Eclipse Debugger"><img src="http://sziebert.net/images/thumbs/eclipse-breakpoint.jpg" alt="Eclipse Debugger" /></a></p>
<p>That&#8217;s it!  You are now debugging your Red5 application.  If you aren&#8217;t sure what to do next, I would suggest that you read this <a href="http://www.ibm.com/developerworks/opensource/library/os-ecbug/">article</a> over at IBM&#8217;s developerWorks. </p>
<p>With these startup scripts, it is even possible to debug Red5 itself.  You&#8217;ll need to have the latest code checked out from Subversion and the project open in Eclipse.  Start the server in the same manner, create or open the debug profile and start debugging.</p>
<p>1. <a name="red5" href="http://osflash.org/red5">http://osflash.org/red5</a> For those that aren’t up on Red5, it is a robust Flash Media Server alternative written entirely in Java that supports multi-user video chat, video streaming and real-time, multi-player gaming.</p>
<p>2. <a name="eclipse" href="http://www.eclipse.org">www.eclipse.org</a> Eclipse is an open source community whose projects are focused on building an open development platform comprised of extensible frameworks, tools and runtimes for building, deploying and managing software across the lifecycle.</p>
]]></description>
		<wfw:commentRss>http://sziebert.net/posts/remote-debugging-red5-applications/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Server-side ActionScript plugin for Eclipse</title>
		<link>http://sziebert.net/posts/server-side-actionscript-plugin-for-eclipse/</link>
		<comments>http://sziebert.net/posts/server-side-actionscript-plugin-for-eclipse/#comments</comments>
		<pubDate>Fri, 24 Aug 2007 17:26:41 +0000</pubDate>
		<dc:creator>Carl Sziebert</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Flash Media Server]]></category>
		<category><![CDATA[SSAS]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://sziebert.net/posts/server-side-actionscript-plugin-for-eclipse/</guid>
		<description><![CDATA[<p>Server-side ActionScript (SSAS) has long been the bastard child of the ActionScript permutations.  There are a number of editors that offer syntax highlighting and in the case of the Flash development tool, the bare minimum of auto-completion features for SSAS.  That is until now.<!--more--> FCZone has put together an excellent plugin for the Eclipse platform that makes editing SSAS a joy.  They are even porting it to the Mac and other *nix operating systems for those of us that prefer not to work on Windows.</p>
<p><span style="text-decoration: line-through;">Grab the plugin here: </span><a href="http://fczone.com/eclipse/"><span style="text-decoration: line-through;">http://fczone.com/eclipse/</span></a></p>
<p>Seems as though the original link is no longer valid. Fret not for <a href="http://www.igorcosta.org/?p=151">Igor Costa</a> has created a mirror: <a href="http://www.igorcosta.org/downloads/fmseditor_eclipseplugin.zip">http:​/​/​www.igorcosta.org/​downloads/​fmseditor_eclipseplugin.zip</a></p>
]]></description>
		<wfw:commentRss>http://sziebert.net/posts/server-side-actionscript-plugin-for-eclipse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
