New topics: Your Pet, IOU, Baby IQ, The Poisons, Birther II, Games, Future Power

Welcome to the Tech Space!

Microsoft Related

Skip to end of metadata
Go to start of metadata
The Problem
So far I have two projects:
  • 1. Front end Flash code for UI
  • 2. Back end Java code to run in the server
    I can set breakpoints in the java code, and hit those breakpoints when I call the java from a Flex remoteObject.

I've setup the Flash code to call the Java objects to do things. I can set breakpoints on the java objects. I'm having lots of fun stepping through the java code I wrote. Eventually, my routine is ready to return its result. I click "Run -> Continue" to let the result return to Flash.

Meanwhile, the Flash UI has already thrown a timeout fault. It took exception to waiting for me.

There is a requestTimeout that can be configured in Flash to zero, which means no timeout:

// When debugging, prevent timeout
_remObj.requestTimeout = 0;

Recompiled my front end, ran it, let it call java, I played in java, let the results return, and got this into my failure handler, exactly 30 seconds after the call: "error: NetConnection.Call.Failed: HTTP: Failed"

Great, I get 30 seconds to finish debugging the call, or it times out.

So this is not just debugging. It's more like safecracking....

Here's the documentation for that field:

"mx.rpc.AbstractService.requestTimeout(value:int):void
Provides access to the request timeout in seconds for sent messages. A value less than or equal to zero prevents request timeout"

Do you think Mozart had to spend time debugging his piano? Maybe that's a thought more tools developers should have in mind....

From Of Patrons, Paramours, and Java Flex Remoting Timeouts

Turns out there were some bugs in this area of timeouts with remoting from Flex and especially Air applications. I am using a late enough SDK that I should not have been encountering them. I suspect the "value less than or equal to zero" documentation is wrong, perhaps because it hasn't been updated.

This bug shows the proper order for setting up the remote object. Notice the use of 240 seconds, instead of just setting to 0.

http://bugs.adobe.com/jira/browse/SDK-30426

// RemoteObject times out after 30 seconds every time
// Created: 05/10/11 02:55 PM   Updated: 05/27/11 11:39 AM   Resolved: 05/27/11 11:38 AM  
// Found in Version: Flex SDK 4.5 (Release) - 4.5.0.20967  
remoteObject = new RemoteObject( serviceName ); 
remoteObject.requestTimeout = 240; // 4 minute request timeout 
remoteObject.channelSet = new ChannelSet(); 
var amfChannel:AMFChannel = new AMFChannel( "my-amf", applicationModel.environment.endpoint ); 
amfChannel.netConnection.httpIdleTimeout = remoteObject.requestTimeout * 1000; 
remoteObject.channelSet.addChannel( amfChannel ); 
 

Using this technique, I was able to sit around in Eclipse debugger looking at my remote object's java code for at least 2 minutes. I will now explore a longer timeout when debugging.

Other related bugs and documentation:

Some people possibly still encountering issues (May 2011):

Possibly Related issues:

Eclipse debugging:

References:

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.