Colin Harrington

RIA

MacOSX :: FlexBuilder + symbolic links = badness

by on Aug.30, 2008, under Flex, RIA

FlexAt work I use the FlexBuilder as an eclipse plugin.  I’m a fan of eclipse so far, it has served me well in the past for Java development.

I tried using symbolic links (ln –s, also called symlinks or soft-links) to manage switching between branches, etc.  Flex Builder didn’t like that. 
I didn’t have any source attachment, I had to do a clean to actually rebuild the application, and other badness (Eclipse resource exceptions).

for example:
machine-name% ln -s project-trunk project
machine-name% ls -lha
...
lrwxr-xr-x   1 username  DOMAIN\users    12B Jul 15 15:35 project -> project-trunk
drwxr-xr-x   2 username  DOMAIN\users    68B Jul 15 15:35 project-1.2.3
drwxr-xr-x   2 username  DOMAIN\users    68B Jul 15 15:35 project-trunk

What did I learn?  Don’t use symbolic links with Flex Builder 3.0.

Hope It saves someone some pain.  I’d guess something in the middle(OS Layer? Eclipse?) is actually walking the symlink inconsistently.  No resolution to this issue yet.  Is this the responsibility of the OS? Eclipse, Multi-platform code?  Let me know if you see a fix for this.

While I’m at it — I also ran into this one http://bugs.adobe.com/jira/browse/FBE-186

2 Comments :, more...

Flex Builder 3.0 Debugging issue – Unable to debug

by on Aug.19, 2008, under Flex, RIA

FlexI recently ran into an issue where Flex Builder 3.0 wouldn’t let me debug and caused my whole System (OSX) to grind to a halt.  It took me a while to get to the bottom of it, but I found the issue and addressed it. 

Basically Eclipse had this error –over and over and over and ove…100+MB worth :-) in the system.log
Aug 17 15:21:31 machine-name [0x0-0xc30c3].org.eclipse.eclipse[8730]: !ENTRY com.adobe.flexbuilder.debug 4 2 2008-08-07 15:21:31.716
Aug 17 15:21:31 machine-name [0x0-0xc30c3].org.eclipse.eclipse[8730]: !MESSAGE Problems occurred when invoking code from plug-in: "com.adobe.flexbuilder.debug".
Aug 17 15:21:31 machine-name [0x0-0xc30c3].org.eclipse.eclipse[8730]: !STACK 0
Aug 17 15:21:31 machine-name [0x0-0xc30c3].org.eclipse.eclipse[8730]: java.lang.NullPointerException
Aug 17 15:21:31 machine-name [0x0-0xc30c3].org.eclipse.eclipse[8730]:     at com.adobe.flexbuilder.debug.breakpoints.FlexLineBreakpoint.findSourceFiles(FlexLineBreakpoint.java:388)
Aug 17 15:21:31 machine-name [0x0-0xc30c3].org.eclipse.eclipse[8730]:     at com.adobe.flexbuilder.debug.breakpoints.FlexLineBreakpoint.instantiate(FlexLineBreakpoint.java:442)
Aug 17 15:21:31 machine-name [0x0-0xc30c3].org.eclipse.eclipse[8730]:     at com.adobe.flexbuilder.debug.model.FlexDebugTarget.breakpointAdded(FlexDebugTarget.java:889)
Aug 17 15:21:31 machine-name [0x0-0xc30c3].org.eclipse.eclipse[8730]:     at com.adobe.flexbuilder.debug.model.FlexDebugTarget$FdbThread.installDeferredBreakpoints(FlexDebugTarget.java:539)
Aug 17 15:21:31 machine-name [0x0-0xc30c3].org.eclipse.eclipse[8730]:     at com.adobe.flexbuilder.debug.model.FlexDebugTarget$FdbThread.advanceStateMachine(FlexDebugTarget.java:570)
Aug 17 15:21:31 machine-name [0x0-0xc30c3].org.eclipse.eclipse[8730]:     at com.adobe.flexbuilder.debug.model.FlexDebugTarget$FdbThread.access$6(FlexDebugTarget.java:544)
Aug 17 15:21:31 machine-name [0x0-0xc30c3].org.eclipse.eclipse[8730]:     at com.adobe.flexbuilder.debug.model.FlexDebugTarget$1.run(FlexDebugTarget.java:646)
Aug 17 15:21:31 machine-name [0x0-0xc30c3].org.eclipse.eclipse[8730]:     at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
Aug 17 15:21:31 machine-name [0x0-0xc30c3].org.eclipse.eclipse[8730]:     at org.eclipse.core.runtime.Platform.run(Platform.java:857)
Aug 17 15:21:31 machine-name [0x0-0xc30c3].org.eclipse.eclipse[8730]:     at com.adobe.flexbuilder.debug.model.FlexDebugTarget$FdbThread.eventLoop(FlexDebugTarget.java:626)
Aug 17 15:21:31 machine-name [0x0-0xc30c3].org.eclipse.eclipse[8730]:     at com.adobe.flexbuilder.debug.model.FlexDebugTarget$FdbThread.run(FlexDebugTarget.java:687)
Aug 17 15:21:31 machine-name [0x0-0xc30c3].org.eclipse.eclipse[8730]:     at java.lang.Thread.run(Thread.java:613)

A little googling turned up this article where the guy points to a setting in the mm.cfg.  Issue resolved?  Not so fast.  My issue had similar symptoms but was not identical.  After some trial and error I figured out that I had been building the SWFs in two different fasions: via ant and with Flex Builder.  So it turns out that Flex Builder was finding the SWFs built by my build files and going into a recurring NPE fit.  Flex Builder basically inundated the system.log to the point of no return.  I could have waited for 2 days, but I chose to manually rotate the log myself (which took some googling to turn up the right solution).

Hopefully Flex Builder 3.0 has fixed this.

Symptoms:
Flex Builder hangs when setting a breakpoint (can’t debug – Eclipse and the system goes ‘out-to-lunch’)

Solution:

  • Remove the duplicate swf’s or profiling versions
  • Your machine still out to lunch? (syslogd)   Then you will have to manually rotate your system log, since its too much for syslogd to handle.

sudo launchctl stop com.apple.syslogd && sudo mv /private/var/log/system.log ~/system.log.NPEFilled && sudo launchctl start com.apple.syslogd
(Stop syslogd, move the system.log file, start syslogd)

  • Happy Debugging!


Reasoning:
Flex Builder goes into a flurry of recurring java.lang.NullPointerExceptions when trying to resolve the source attachment when there are multiple versions of the same swf.  You won’t be able to debug or set a breakpoint.  If you do, Your system log will be overloaded because of the massive onslaught of NPEs reported by Eclipse/Flex Builder.  Syslogd tried to rotate the system log but it is just too large for it to handle after you’d let the recurring NPEs go on for a minute, so manually rotating the log seems like a good solution (got a better one?)

2 Comments :, , , more...

Flex doesn’t have a String#replaceAll()?

by on Jul.15, 2008, under Flex, RIA

Flex Logo on WhiteWhat?!?  I was shocked to learn that the latest Flex framework / Actionscript doesn’t have an equivalent for a replaceAll() on String.  I’m looking for a simple way to do replacements on a string.  Most of the languages that I’ve worked with have such a method or a library to provide that functionality.  PHP has the str_replace function, Java has a replaceAll() on java.lang.String, Python has it, C++ has libraries that readily provide this functionality, the System.String in the .NET framework(1.0,1.1,2.0, etc.) has a string#replace method, even in the RIA space, Silverlight has a replace method on System.String, as does JavaFX (java.lang.String).

After searching and reading for a while, the closest equivalent that I could find is a custom method that utilizes the split and join functionality like the following:

public static function StringReplaceAll( source:String, find:String, replacement:String ) : String
{
    return source.split( find ).join( replacement );
}

The preceding function came from Base64.as from Jason Nussbaum’s blog post about Base64 encoding/decoding.   Others have used similar functionality like this post on flexfanatic. Its definitely better than while loop.

I also found that it is possible to utilize a RegExp within the String#replace function as shown on SCRIBBLE IT.  Basically the code would look like:

var str:string = "Somesilly String. silly!";
str.replace(new RegEx("silly", "g") " awesome");

With this pattern it can still be a one-liner, which should preform better than the split/join methodology, but I am still shocked that such a standard method isn’t in the framework.  I am a bit surprised by this finding.  is there a better way?  A good StringUtil Library or something similar?

24 Comments : more...

Microsoft Silverlight and SOA

by on Apr.14, 2008, under Groovy-Grails, RIA, Silverlight

Video Podcast Administration Demo ScreenshotThis past weekend I spoke at the Twin Cities Code Camp.  It was a Blast.   My Presentation was Microsoft Silverlight and SOA.  Its new technology so resources at this point are few and far between.  Silverlight itself is only a a 2.0 Beta 1 stage.

During the presentation, I highlighted Silverlight’s abilities to consume and invoke web services.  I wanted to show cross-domain services calls where the server is a non-microsoft based application.

I developed a RESTful Server application in Grails on Linux. 

The demo Silverlight application is a Video Podcast Administration Application.  I specifically wanted to show several client side methods of invoking web services.  I didn’t want to focus on any fancy visual effects video transformations etc. 

Here is code for the Grails Server.

Here is the Silverlight Application code.

 

My Presentation is in a Google Doc.

 

I had a blast at Code Camp, It sounds like something I’ll probably do again.

I might also put a short video together to show its functionality for Inetium. I’ll be sure to post it here.

Cheers!

9 Comments :, , more...

Preparing Silverlight & SOA Presentation

by on Mar.25, 2008, under RIA, Silverlight

N-Tier ApplicationOk now I’m getting around to putting my actual presentation slides together for Code Camp and I needed some Graphics for it.

I didn’t find anything that was simple enough and I could use free of charge.  I ended up baking some of my own illustrations.

Here is a link to the larger version.  I’m trying to illustrate the Traditional N-Tier application architecture.

And nope, no Silverlight on the iPhone… yet.

 

Here is another one that briefly touches on the distributed nature of SOA

Leave a Comment :, , more...

Silverlight on the iPhone Hints?

by on Mar.06, 2008, under RIA, Silverlight

As Mix ’08 is currently going on.  Scott Guthrie said something that peaked my interest.

He basically said that

"Our goal is to try to get it on as many mobile devices and allow you to just take advantage of it umm with a variety of different clients… Everything that has an SDK"

He was very hesitant when he said it.  Did he allude to Silverlight iPhone??  The timing is impecable.  He said this on Wednesday March 5th 2008, where the Apple event is today March 6th 2008.

You can view what he said by accessing http://wm.istreamplanet.com/customers/ms/750_microsoft_mix_080305.asx in Windows Media Player or VLC or other compatible player.  He said it at 2:26:00

I wonder if Adobe has something between Desktop Flash and Flash Lite?  I would still like to see flash on the iPhone, Maybe the iPhone SDK will allow that?

Only time will tell…

 

1 Comment :, , , more...

Silverlight Presentation

by on Jan.20, 2008, under RIA, Silverlight

I’m in the process of putting together a presentation for the Twin Cities Code Camp on April 5th 2008.

I am going to focus on Silverlight media (video), and SOA.
Standard asmx web service
WCF Services
JSON based Services (via Grails or PHP)

I may do some page interaction Javascript events etc. Maybe even loading Data from a small EXTJs App.

I’ll have fun with this.  I’ll try to do some live video along with it.

What do you think?

 

 

1 Comment :, , , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!