Archive for February, 2008
OS Update: Windows Server 2003 64-bit
Posted by: | CommentsWindows Server 2003 Enterprise (32-bit) was an excellent platform for web and software development, one that I have been using since I purchased my laptop in 2005. I could never find adequate video drivers for it, but that was fine as I do most of my gaming on one of my Windows XP machines. Other than that small complaint, I didn’t have any problems that weren’t solved by a quick Google search and maybe a file download. I often felt slightly dismayed that I was running a 32-bit OS on a 64-bit processor, and I finally decided to remedy this in January by installing Windows Server 2003 Enterprise 64-bit edition.
I haven’t been nearly as pleased with it, and after almost 2 months I’m preparing to go back to the 32-bit edition. I thought the driver situation for x64 would be comparable to x32, boy was I wrong. I found a 64 bit video driver that doesn’t work properly for my system, I still haven’t gotten sound to work, and to be honest I haven’t really noticed any difference when running my 64 bit applications (in performance or responsiveness). There are a number of applications that I used to use regularly that A) don’t work correctly, B) won’t install, and/or C) Have no 64-bit version.
I’m not sure exactly what I was expecting, but I was expecting it to be better than this. I normally wipe my system and do a fresh install every year to 18 months, but the idea of going even another month like this is out of the question.
Error Iterating Through HTTPService Results
Posted by: | CommentsI was recently up at arms because of an error I was getting while iterating through the results of an HTTPService in my Flex application. The error would only present itself if there was exactly one result returned (the service was returning plaintext XML) but not when there were 0 or more than one. Stepping through the code revealed that the result was indeed there, but rather than iterating through a collection of results with only one member, it was iterating through the properties of that one result. This resulted in the message:
ReferenceError: Error #1069: Property id not found on int and there is no default value.
after the program crashed).
I really thought this was a bug in the Actionscript implementation, so I tried using the Flex 3 SDK to compile, but the error was still manifest. So I checked Adobe’s issue tracking site, figuring someone else had to be having the same problem I was, and sure enough I was able to find two tickets describing the same problem (tickets SDK-14567, and SDK-13699 if you’re interested). To my astonishment they were both marked as ‘resolved, not a bug’.
Here’s the scoop: If there’s only one result then it is returned as an ObjectProxy; if there are more than one it’s returned as an ArrayCollection of ObjectProxys. I thought this was pretty stupid at first, until I realized that if I was only expecting one result back it’d be a hassle to have to treat it like an ArrayCollection.
So anyway, on one of the tickets, they suggested doing something like:
var response : ArrayCollection = new ArrayCollection( ArrayUtil.toArray(event.result.blahs.blah) );
which I presume would have turned a single result into an ArrayCollection so it could be iterated using the for..each..in construct. It didn’t work for me. I ended up having to do a test and then processing each type separately.
I tested using:
( if event.result.blahs.blah is ObjectProxy )
and two helper functions; one that iterated over the results, and one that handled them directly.
Note: Initially I solved the problem by handling the special processing in the catch of a try..catch block. That was a third-degree hack. What I’m using now isn’t that much better, in my opinion, the real value is that I understand a little better what’s going on. I thought I could force the service to return as an Array but that didn’t work for me either (possibly because I was still processing it like XML).
Maven: Rebuilds Everything!
Posted by: | CommentsI use Maven as my primary build & deploy utility for the Flex/Java development that I do. It may be a configuration error on my part that I’ll eventually need to look into, but every time I build my project, Maven builds the entire thing. This is especially annoying in two circumstances… first, when the Java development is pretty much finished and generally does not change from build to build; second, when the project starts getting longer (I have some that take 0:45-1:30 minutes to build, and some of my colleagues have projects that take longer).
This is going to seem trivial, but I’ve started using Flex Builder to do most of my incremental builds, while leaving JBoss (hosting my Java backend) running. The only change I’ve had to make is in my Services.mxml. Since Flex Builder deploys to http://localhost, and JBoss has my services running on http://localhost:8080, I’ve just had to change the RemoteObject endpoint from messagebroker/amf to the full URL, http://localhost:8080/project-name/messagebroker/amf. And now my builds take about 10 seconds.
Whenever I make a change to the Java, or want to deploy a full EAR, I just change it back and run Maven. To facilitate changing back and forth, I’ve declared a constant with my two endpoints, and bound the endpoint property of the RemoteObject to the constant. Then I just comment out which constant I don’t want to use.
Simple, somewhat obvious… but a huge time saver.

