Does RemoteObjectAMF0 has concurrency problems?

January 25, 2007 at 5:31 am | Posted in amf, flex2 | 2 Comments

I have a “weird” problem in my app…

This is my test:

Server Side:
a) I have a generic pageable search service in Java (I’am using RemoteObjectAMF0 and openamf). It returns a list (a page of results) with value objects. Value Objects’ Class is determined by service params.

Client Side:
b) I have two different forms that use that search service. (Each form belongs to a different Module). Form 1 expects objects of Type A and Form 2 expects objects of Type B. Both forms are at the same time on screen
a kind of MDI…I hope so… 😉
I am using cairngorm 2.1. (a command is created per event instance)

c) Some searches with Form 1 : works fine. (my pageable Datagrid is simple.. but looks fine 😛 )

d) Some searches with Form 2: works fine.

e) “Parallel” search with form 1 and form 2:
Firs request of screen 1 and second request (almost parallel) of screen 2

f)Server logs are ok for both requests:
First Response : [results for form 2, only 777 objects]
2007-01-22 01:07:57,859 estimatedTotalResultsCount:777
Total Pages:4 Pagesize:200
startIndex: 0 lastIndex:199}]

Second Response : [results for form 1,  131.427 expected]
2007-01-22 01:07:57,890 estimatedTotalResultsCount:131427
Total Pages:658 Pagesize:200
startIndex: 0 lastIndex:199}]

g) Client side Brokes. It seems that “something” puts response of service 1 in service 2.
[postprocessing of object (ordering) fails, caused by “mixes(?)” of responses?? ]

This is the code of my Command:

private var recievedEvent : SearchEvent;

public function execute( event : CairngormEvent ): void {
var delegate : SearchDelegate = new SearchDelegate( this );
recievedEvent = SearchEvent( event );;

public function result( event : Object ) : void {
var search:Search = event.result as Search;

h) Its a little weird problem… Search works fine individually.. but in “parallel” brokes.
– Could be a concurrency problem in service processing? (RemoteObjectAMF0)
– Could be a problem in cairngorm?
– Could be a problem in my own code?

Any Help?

(“dumb” “solution”:  Hour Glass Functionality that blocks user interaction during remote service invocation calls?  How could this “hour glass” could be implemented using RemoteObjectAMF0 ?  … I was looking some code.. and probably some classes in RemoteObjectAMF0 package must be extended….)

Extending TitleWindow (SizeableTitleWindow/MaxRestorePanel, or the beauty of inheritance )

January 22, 2007 at 3:08 am | Posted in components, flash, flex2 | 4 Comments

Creating custom components with flex 2 is really easy, even if you are new to mxml and as3. (To develop custom components in flash 8 you need great knowledge of as2 and component’s architecture…)

In Flex 2 TitleWindow doesn’t support sizeable capabilities or custom buttons (only “x” button). Based in 2 examples (SizeableTitleWindow and MaxRestorePanel ) you can extend TitleWindow and achieve such functionalities.

1. Freely Available “SizeableTitleWindow” With Adobe’s ColdFusion/Flex Connectivity

To make it work you have to change a couple of lines:

Re: [flexcoders] Re: Resizable, Collapsible, Draggable Panel??

2. Now Extend your SizeableTitleWindow with MaxRestorePanel: (Code here: [flexcoders] Re: custom Panels original size ). Original MaxRestorePanel extends Panel, you can change it to extend SizeableTitleWindow… and voilá… this is your first custom flex 2 component…

It is really a copy-paste custom component… but looking to the code you can learn some internals related to components architecture and how to build your own extensions… specially in SizeableTitleWindow’s code.

(Offtopic: my first flash RIA was made with Flash MX, those components are the “great-grandfathers” of flex 2 … this is an amazing evolution of flash as a platform to develop business applications.  Thank you Adobe/Macromedia ).

Flash debug player 9,0,28,0 – Problems on Install

January 13, 2007 at 4:04 pm | Posted in Flash Player | Leave a comment

I had some problems installing version 9,0,28,0 of the flash debug player…never updates the flashlog.txt (internet explorer or firefox)… I had to get back to 9,0,15,0 version.. ( in firefox… Internet explorer never works…)

These are some related links that can help you (but none works for my flashlog.txt problem 😦 ):

Flash Player Downloads

Flex Builder 2 Issue: Installed Flash Player is Not a Debugger

Installing Flash Player 9

Debugging Client-Side Code in Flex Applications

Livedocs: Configuring the debugger version of Flash Player

Trace from the browser, using standard trace()


Finally (after some other tests…)

– Debugging with flex builder was possible using Internet Explorer and player 9,0,28,0 (forget firefox debugging…)… including debugging of Modules

– External  flashlog.txt isn’t generated with debug player 9,0,28,0 in my development enviroment (IE or Firefox).

Debugging Modules With Flex Builder (possible?)

January 11, 2007 at 6:20 am | Posted in flex2, Rich Internet Applications | 4 Comments

This is my first post in my “technical” blog … (another new year “purpose”)… Warning… my written english is really bad (english classes … another “purpose” for this year)…

I was trying to debug my app (that loads forms compiled in modules) with flex builder 2.0.1 ( installed as a plugin in eclipse 3.2.1) but it didn’t work… his is the description of my “environment” and steps to “reproduce” the “incident”:

1. The App: A Main application, A module with a breakpoint in the initialization method.

2. 05:33:16.156 [DEBUG] MyFlexApp This is a debug session… (ok… my app has been loaded…and my logger works fine… I had to make a “trick” to detect that the application was started in debug mode or normal mode… [sorry.. I`am a begginer in flex2..] )

3. The user selects an option of a MenuBar (the user wants to see a module of the application… )

4. 05:50:56.296 [DEBUG] AppWorkspace Loading Window: MySearchModule-debug.swf (ok… application is loading the correct debug.swf… according to “One-project model”)

5. My user is happy… he can see loading progress in a ProgressBar (easy… really easy… <mx:ProgressBar id=”progressBar” width=”80%” source=”{moduleLoader}” textAlign=”center”/> … forget old days of MovieClipLoader…)

6. Flex builder debugger freezes (mmmm this is not good…)

7. Firefox with flash debug player 9,0,15,0 freezes too (mmm .. did I say that my OS is WinXp?…)

8. Firefox with flash debug player 9,0,15,0 Crashes… (now my user isn’t happy and wants to kick my ass … I tell him that this is a new Feature of the product in te current build: “Close firefox directly from the MenuBar in the flex application“)

Firefox Error

9. 30 seconds trying to kill the crashed process…

10. Restart firefox, Restart eclipse.

11. Another test…and total crash repeats…

11. Post incident to flexcoders (maybe someone at adobe could read this … and give some advice 😛 ).

12. setInterval(this, “waitForHelpAboutDebuggingModules”, 1000*60*60); //old school…

13. Goto sleep.//old old school.

Update 2007/01/16
New Documentation here:

Modules documentation update

and here Debugging with Flex Modules where Kevin Hammer has a similar approach to my “experiment”… using the “this.url” trick in Application…
in addition.. when running in debug mode “generates” localhost gateway url for (debug only) connection with openamf running locally in tomcat…

My newbie “as3 and flex2” code is here:

In my main Application:

var pattern:RegExp = /MyFlexApp.swf/;
var baseUrl:String = this.url;
if(baseUrl.indexOf(“file://”, 0) > -1){
//Note: For local debugging Only
if(baseUrl.indexOf(“debug”, 0) > -1){
logger.debug(“This is a debug session…”);
MainAppModelLocator.getInstance().isDebugSession = true;
baseUrl = “;;
baseUrl = baseUrl.replace(pattern,””)+”gateway”;
} = baseUrl;

There is another component that “observes” user’s requests for loading new modules… the code is something like this:
public function observeShowModule():void{
var newWindow:MyWindow = PopUpManager.createPopUp(this,MyWindow, false) as MyWindow;

var moduleUrl:String = MainAppModelLocator.getInstance().currentShowModuleEvent.url;
var pattern:RegExp = /.swf/;
moduleUrl = moduleUrl.replace(pattern,”-debug.swf”);

logger.debug(“Loading Window: “+moduleUrl);

Create a free website or blog at
Entries and comments feeds.