Copy link to clipboard
Copied
Essentially the issue is long running RemoteObject requests timeout on Windows and setting requestTimeOut on the remoteObject or setting URLRequestDefaults.idleTimeOut to a high number are ignored and the request times out after 30 seconds.
There's been quite a number of posts on this subject and at times the issue was reportedly addressed or worked around, but I'm still seeing this issue on Flex SDK 4.1 (AIR 2.02). The request times out no matter what I do (on Windows).
A brute force approach would be to break down what I'm trying to retrieve into smaller chunks and assemble the results on the client, but that doesn't give complete confidence that some request may exceed 30 seconds when the servers are under load.
Any advice would be appreciated.
Here are a few posts/JIRA entries that reference the issue:
https://bugs.adobe.com/jira/browse/SDK-15403
https://bugs.adobe.com/jira/browse/SDK-22016
http://blogs.adobe.com/cantrell/2009/10/introducing_urlrequest_idletimeout.html
Thanks,
Jeff
Copy link to clipboard
Copied
Thank you jzgoda...you are correct..it was due to 'version' part which I am using for 2.7...!!! For 2.5 and greater, we should use 'versionNumber' instead of 'version'.But still I am getting the timeout issue after 30 seconds when I am using FileReference.download() method even if I am using 'URLRequestDefaults.idleTimeout = 180000;' ..!!! So that bug has not been fixed yet by adobe ???
Copy link to clipboard
Copied
Sorry, I'm not sure about FileReference.download()...I don't personally use that class or method. I was getting the errors with RemoteObject over SecureAMFChannel, which has since been resolved.
Copy link to clipboard
Copied
So can we confirm that this bug still exists for FileReference.download() method as well ? Because now I am using Flex 4.0 SDK with 2.7 AIR SDK and 2.7 namespace .... but bug still there ..!!!
To reproduce this issue,please do the following steps.
*****************************************************************
1) Create a sample AIR application with one download button which invokes following method on 'click' event.
private function downloadFile():void {
var fileRef:FileReference=new FileReference();
fileRef.addEventListener(Event.COMPLETE, complete);
fileRef.addEventListener(SecurityErrorEvent.SECURITY_ERROR, secerror);
//fileRef.addEventListener(IOErrorEvent.IO_ERROR, ioerror);
fileRef.addEventListener(Event.OPEN, open);
fileRef.addEventListener(HTTPStatusEvent.HTTP_STATUS, httperror);
fileRef.addEventListener(ProgressEvent.PROGRESS, progress);
var url:URLRequest=new URLRequest();
URLRequestDefaults.idleTimeout = 180000;
url.url="http://localhost:8080/sampleproject/downloadservlet";
fileRef.download(url, 'SampleExcel.xls');
}
2) create a java servlet class and run this servlet in one project 'sampleproject' in server.This servlet will create one excel and holds the request for 70 seconds and push this file to client (our flex request).
public void doGet(HttpServletRequest req, HttpServletResponse response)
throws ServletException, IOException {
OutputStream out = null;
try {
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition",
"attachment; filename=sampleName.xls");
WritableWorkbook w = Workbook.createWorkbook(response
.getOutputStream());
WritableSheet s = w.createSheet("Demo", 0);
for (int i = 1; i < 70; i++) {
Thread.currentThread().sleep(1000);
System.out.println("Thread running now .. " + i);
}
s.addCell(new Label(0, 0, "Hello World"));
w.write();
w.close();
} catch (Exception e) {
throw new ServletException("Exception in Excel Sample Servlet", e);
} finally {
if (out != null)
out.close();
}
}
3) When we click on download button,as you can see IO Error being poped up after 30 seconds ..!!! Please provide a workaround for this ...
Copy link to clipboard
Copied
Hi,
Please provide me a solution or please confirm that this bug has not been fixed yet by Adobe for FileReference.download() method .....
Copy link to clipboard
Copied
Thanks for the sample code. I just posted in your other thread, but can you copy / paste your post into a new bug report over at bugbase.adobe.com?
Thanks,
Chris
Copy link to clipboard
Copied
Hi Chris,
Thanks for your reply.I have raised the bug.
Copy link to clipboard
Copied
This is a temporary (permanent?) solution to this problem
applying URLRequestDefaults.idleTimeout in AIR appa, then extending this setting to a SWF loaded from server, and allowing the setting to apply when the SWF loads other data from the server:
essentially:
loading with URLLoader.dataFormat = URLLoaderDataFormat.BINARY
setting context.allowCodeImport = true
load same bytes again with loader.loadBytes(bytes, context)
for anyone whom may need this...
/javier
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more