This year Adobe Max 2009 is in my own backyard, well sort of 6 miles up the street, which means about an hour away in LA traffic. I am hoping to get in for free some how, either through Adobe Max Awards or by posting the Adobe Max Widget. See everyone there, maybe…
Tag Archives: Adobe
Flex 3, ColdFusion 8, and Error #1034
Working on project for a new client I had had the opportunity to use Flash Remoting from Flex to talk to services on a ColdFusion server without running the ColdFusion server locally on my machine. Since I am working remote these days (at home), I wanted to connect to the CFC’s on the ColdFusion server remotely from my local Flex Builder 3 working environment. I setup a simple “Hello World” example that I found over at ASFusion.
I uploaded the HelloWorldService.cfc file to the remote server in “C:\ColdFurion8\wwwroot\components\com\test\HelloWolrdService”. I then set up a RemoteObject with the endpoint property pointing to the remote ColdFusion server instead of the local host (since the example points to a local host):
<mx:remoteobject id="CFCService" endpoint="http://myremoteserver.com/flashservices/gateway/" source="components.com.test.HelloWorldService" result="getResponse(event.result)">
But I got a “Security Sandbox Error” right away from the call. This usually tells me that there needs to be a crossdomain.xml file on the root of server allowing access from my specific location or completely open using the “*” value. For more on the Flash security policy, check out plenty of info at Adobe’s site.
I uploaded the crossdomain.xml file to the root with the proper security settings (completely open in my case) and gave the server a restart just for kicks (though I don’t think its required when you change or modify the crossdomain.xml file under normal circumstances (I had some other issues unrelated to this blog post, but our admin was able to unblock those, basically the server also runs an additional web server on the same box as ColdFusion which was caused problems temporarily). So I ran the example again and received this error:
Error #1034: Type Coercion failed: cannot convert Object@359af2e1 to mx.messaging.messages.ErrorMessage
This error really stumped me because I am by no means any expert at ColdFusion and it has been years since I have had to mess around with it in any fashion. I searched and searched for this error in relation to ColdFusion and Flex. I was pulling my hair out, was it the port, was it the server address, was it the location of the CFC files, what was the issue?
I was really surprised at all the examples I found, they all were setup with both Flex and ColdFusion running on the same machine. Almost nobody was running Flex locally and accessing ColdFusion CFC’s remotely, and this is what I really needed. I eventually found a post on FlashComGuru where the author had the same exact problem as me.
It turns out that my RemoteObject had a couple of issues. First, it needed to have the destination property set, in this case ColdFusion is the default name set in services-config.xml file. Second, I had to change the endpoint property from “http://myremoteserver.com/flashservices/gateway/” to “http://myremoteserver.com/flex2gateway/”, changing the default gateway of the remote server to “flex2gateway”. So my updated RemoteObject code looks like this:
<mx:remoteobject id="CFCService" endpoint="http://myremoteserver.com/flex2gateway/" source="components.com.test.HelloWorldService" result="getResponse(event.result)">
Finally, the Hello World example worked great! However, when I tried the application I was working on to hit the application specific CFC files, I didn’t get the results I wanted. As I mentioned briefly before, the server is also running another web server on the same box as the ColdFusion server. So the web root of the web server is “inetpub/wwwroot/” and the application CFC’s were located under this web server’s directory. In order to get them to work for me, I had to move them to the ColdFusion wwwroot folder “C:\ColdFurion8\wwwroot\components\”.
I am sure there is a way to map the ColdFusion component directory to another server, but to save time and get myself back on schedule, I settled with placing my CFC file son the ColdFusion server instead, for now anyways.
I hope this post is at least a pointer to a very hard to track issue with using Flash Remoting with Flex and ColdFusion 8. The kind of lighthouse for those Flex developers who might find themselves in the same bind
.
-Mister
Drop your framework?
After attending an interesting session at Adobe MAX 2008 titled “The Flex Architecture Face-off”. At first I though the speakers (Yakov Fain, Chafic Kazoun, Todd Anderson, and Joshua Noble) were going to debate which framework was the best, you know, Cairngorm, PureMVC, Mate, and others. Initially the speaker surveyed which frameworks developers were using and not surprisingly, most were using Cairngorm (followed by PureMVC, then Mate). Then the speaker asked who wasn’t using a framework at all, and I was again surprised to see that about half of the audience wasn’t using any framework. You see I come from the thought that you need to have a framework in your box of tools to build most projects, they help coordinate group efforts, and they offer support. I had always just assumed that most Flex developers would be using some type of framework and that the flavor of framework was the only point of contention.
What made this particular session interesting was how the discussion turned into a debate, not about one framework versus another, but a debate about if you want to use a framework at all. The panel was mostly split. Chafic and Yakov were obviously not for using frameworks, while Todd and Joshua recommended using frameworks. The reason for using a framework varied. Some developers use them because it helps to coordinate the work when you have groups of developers, others use them because the client had stipulated that it was a “best” practice to have a framework. This make sense because you know that even though projects have a development life cycle, they will also have a maintenance life cycle. This means that the next group of developers coming in after you will need to go through your code and using a framework seems to facilitate this process.
Secure login using the EncryptedLocalStore in Adobe AIR
Adobe AIR has a quick and safe way to store encrypted user data when building applications. Data such as login and password can be persisted in the application using the EncryptedLocalStore available for AIR applications.
To demonstrate this, I wrote a quick demo application that will store username and password after users login. When the application is launched again, the same username and password will be retrieved from the EncryptedLocalStore and propagate the login and password text boxes. User’s also have the option to reset the data and store a new username and password, removing the stored data from the EcryptedLocalStore.
This can be handy when you want your application to do auto-login, using the existing stored information from the user’s previous session, and of course, the stored data is encrypted.
Example:
[as lang="ActionScript"]
[/as]
To use the example code, just create a new AIR application in Flex Builder and paste the code into your main MXML file.
-Mister
FITC Hollywood 2007
I was asked to speak at this years FITC conference located at Universal Studios, Hollywood. I will be co-presenting with my co-worker Larry Drolet. Our presentation is called “Concepts on AIR”. We will demonstrated some basic AIR concepts such as system chrome, drag and drop, and system notification. We will also present some pretty cool sample applications. One is called Oxygen, a file management application that manages the Xdrive storage service platform for individual accounts.
Oxygen is build with Flex and AIR technology and uses the open Xdrive API. Xdrive will soon release version 1.2 of the JSON API. Oxygen is running this latest JSON release. Oxygen is a great concept piece as it shows how easy it is to take your web-based Flex applications and port them to the desktop. Oxygen shares about 90% of the same code as Bluestring (Bluestring.com).
Another cool application is called Wormhole. Its basically a mashup with AIM and Xdrive API’s. This application really takes advantage of the system chrome features in Flex and offers a very geeked out way to share files (think Stargate). If you are in the Los Angeles area and have some time, stop by the FITC conference and check out all of the presentations. My presentation description can be found here along with my speaker profile. The presentation slides are listed below using Adobe Share:
https://share.adobe.com/adc/flex/mpt.swf
- Mister
Adobe Share
Adobe recently launched a new beta application called Share that allows you to upload and share files. You can share file to a rostered list, the URL to the file, or embed the file on your web page (as I have done below). Adobe also has a Share API that uses simple REST-based protocol for developers to build their own applications or mashups with using Share. I wasn’t clear from the documentation how the commercial pricing will work or if building an application for others to manage or share their files will count against your account or bandwidth. In fact, I am not sure what the pricing schema is for Share.
Another puzzling thought is why did Adobe develop share to begin with? You have a lot of existing vendors in the storage service provider arena already, in fact, you have many that use Adobe’s existing software to develop tools around storage and sharing. So it is strange that a software company decided to compete with companies that already use its software to provide the same service (Bluestring by AOL is one example). Does this mean that Adobe intends to become an online service for storage, document editing (Buzzword) and media editing (Remix and Photoshop Express)?
I mean, its cool that the applications Adobe builds use their own software (Flex, Flash, etc.), but when they start competing with other companies using also using Adobe software to provide similar services (aka, the bread and butter of those organizations), then I am wondering what will be the outcome? Is Adobe to become a huge conglomerate that not only provides services and software, but competes with its own food source for resources? What’s next, Adobe phones? Of course I am joking. I love Adobe and I love their products. I guess as Flex developer, I’m just comfortable with Adobe providng me with the tools to create applications and not competing with the tools I create. I could totally be misreading this move by Adobe, which is most likely the case (I say this so that a big black panel van with tinted windows doen’t pull up beside me one day and take me away).
Well, time will tell for sure. The storage business is extremely expensive (bandwidth, banks of servers) and there are a lot of established companies already out there with storage and sharing services that offer more space and possibly a lower cost (Xdrive, Box, Mozy, Bluestring, Amazon S3) with sharing capabilities and API’s. For now, the Share API looks to be a simple to use and easy service providing minimal sharing capabilities and less complexity than some other API’s.
Adobe Flash Lite 2.1 and T-Mobile Dash
Happy New Years! I just purchased a new phone, the T-Mobile Dash. The phone uses the Windows Mobile 5, Smart Phone edition. I love this phone, it has a great user interface, feels great in the hand, and it does a fine job with Internet, messaging, and mail services.
The Dash also allowed me to install the new Flash Lite 2.1 Player and SDK. I only wish that Adobe would include some means to play FLV files on mobile devices. You see all the chatter about the Adobe Flash Lite player on the web, and its mostly about how to see Google and YouTube videos on your mobile device. Providing FLV ability would be a huge boost to Flash Lite on mobile devices. I would also like to see some type of file upload ability with the mobile player, maybe next Flash Lite 3?
