Hi Juan,

A few months ago i posted this solution to the list:

http://n2.nabble.com/Re-OpenLayers-Users-Error-when-using-XMLHTTPRequest-throughrefreshing-a-wfs-layer-every-n-seconds-td2732129.html

Also attaché the original email to this message.

Hope this is of help to you

Cheers Kris

-----Original Message-----
From: [email protected] [mailto:[email protected]] On 
Behalf Of Juan Arévalo
Sent: Tuesday, August 25, 2009 12:41 AM
To: [email protected]
Subject: [OpenLayers-Users] Error-when-using-XMLHTTPRequest


Hi all!

All my WFS-T examples were working perfectly till today! However I am now
getting an error when I try to modify my features and I cannot figure out
where the problem is coming from. Here is the error: 


Error: uncaught exception: [Exception... "Component returned failure code:
0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIXMLHttpRequest.send]"  nsresult:
"0xc1f30001 (NS_ERROR_NOT_INITIALIZED)"  location: "JS frame ::
http://127.0.0.1:8080/client/mfbase/openlayers/lib/OpenLayers/Request/XMLHttpRequest.js
:: anonymous :: line 200"  data: no]

I´ve read this post in the forum regarding this problem: 
http://n2.nabble.com/Error-when-using-XMLHTTPRequest-through-refreshing-a-wfs-layer-every-n-seconds-td2721982.html#a2740217

But to me it is not clear what needs to be done in order to solve this
issue! 

My application was nearly finished so any help will be much appreciated!

Thank you!

Juan Arévalo
-- 
View this message in context: 
http://n2.nabble.com/Error-when-using-XMLHTTPRequest-tp3506570p3506570.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users
--- Begin Message ---
Hi all,

 

Found the solution to this and wanted to share that with you ;-)

 

Everytime a new read was done on the layer through refreshing the refresh event 
triggered the update of the BBOX strategy. Here the abort was called on the 
protocol.

In the protocol abort method the abort was propagated to the XMLHttpRequest.

The abort method of the XMLHttpRequest propagated again to the XMLHttpRequest 
native object or the ActiveX object depending on the browser used.

It seems that the abort is not working correctly if readystate has reached 4 
already. So changing that to conditionally propagate the abort only when 
readystate > 0 and < 4 did the trick.

 

Attached you'll find a patch file including this change and also:

-          Setting readystatechange function after open is called (as good 
practice from ajaxian.com: 
http://ajaxian.com/archives/reusing-xmlhttprequest-without-abort)

-          Applied changes from version 1.0.3 of the used library from 
http://code.google.com/p/xmlhttprequest

 

Hope its usefull for anyone (and makes it into a new release).

 

Cheers Kris

 

From: Kris Geusebroek 
Sent: Monday, April 27, 2009 9:52 AM
To: Kris Geusebroek; [email protected]
Subject: RE: [OpenLayers-Users] Error when using XMLHTTPRequest 
(throughrefreshing a wfs layer every n seconds)

 

Hi All,

 

Some further investigating shows that the location of the error (unspecified 
error) is at line 1087 /29937 (for uncompressed openLayers.js)

This is the line in XMLHTTPRequest.js where the this._object.send(vData) is 
called form cXMLHttpRequest.prototype.send

 

In script debugeer I can see that this._aborted = true

But nothing more strange things to see.

 

Anybode knows how I can investigate more?

 

Cheers Kris

 

From: [email protected] [mailto:[email protected]] On 
Behalf Of Kris Geusebroek
Sent: Monday, April 27, 2009 8:17 AM
To: [email protected]
Subject: [OpenLayers-Users] Error when using XMLHTTPRequest (throughrefreshing 
a wfs layer every n seconds)

 

Hi all,

 

When using openlayers to refresh my wfs layers frequently after some time using 
the application (zooming, panning etc while still refreshing every n seconds)

I get an error: unknown error at line 977 (or 1076 sometimes).

After that error the app becomes very unresponsive. Zooming in for example 
takes about 30 seconds after clicking the button in the PanZoom control.

 

My feeling is that the error comes form the XMLHttpRequest code so I need to 
investigate that more.

Anybody know a good help to investigate what goes wrong and to find out how to 
fix this?

 

Environment is IE6 (I know bad choice). But the error also comes in Firefox but 
there the response times remain ok.

 

Any help I much appreciated

 

Cheers

 

Kris Geusebroek

Consultant

 



Email: [email protected] <mailto:[email protected]> 

Tel: +31 (0)35 538 1921

Fax: +31 (0)35 538 1922

Mobile: +31 (0)6 30 697 223

http://www.xebia.com <http://www.xebia.fr/> 

 

Utrechtseweg 49

1213 TL Hilversum

The Netherlands 

 

Xebia Blog !   http://blog.xebia.com/ <http://blog.xebia.com/>    

Xebia Podcast!   http://podcast.xebia.com/ <http://podcast.xebia.com/>  

 

<<image001.jpg>>

Attachment: xmlhttprequest.patch
Description: xmlhttprequest.patch

_______________________________________________
Dev mailing list
[email protected]
http://openlayers.org/mailman/listinfo/dev

--- End Message ---
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to