[RPC Fault faultString="Error #2070

I’m in the process of developing a new Flex 3 RIA, and the server code is not yet written, so I’m using static XML files to provide data while I build out the UI functionality. The XML files are stored on my development machine in a subdirectory of the folder that holds the main SWF. It’s all a very standard setup, and I was successfully loading two files from the same subdirectory, so I was very surprised this morning when I got a security sandbox error:

Error #2070: Security sandbox violation:
caller cannot access Stage owned by .
As implied by the reference to “Stage owned by”, this error is supposed to occur when you are loading a SWF from an unauthorized domain. I did some quick searching on Google, and everything I looked at had to do with loading a SWF. The stack trace did not clarify the issue either:

[RPC Fault faultString="Error #2070: Security sandbox
violation:caller cannot access Stage owned by ."
faultCode="Client.CouldNotDecode" faultDetail="null"]
at mx.rpc.http::HTTPService/http://www.adobe.com/
2006/flex/mx/internal::processResult()
[E:\dev \3.0.x\frameworks\projects\rpc\src\mx\rpc\http
\HTTPService.as:842]
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/
mx/internal::resultHandler()
[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\
AbstractInvoker.as:186]
at mx.rpc::Responder/result()[E:\dev\3.0.x\frameworks\
projects\rpc\src\mx\rpc\Responder.as:41]
at mx.rpc::AsyncRequest/acknowledge()
[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\
AsyncRequest.as:74]
at DirectHTTPMessageResponder/completeHandler()
[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\
messaging\channels\DirectHTTPChannel.as:381]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()
I suspected something was wrong with the XML file, since the UI was successfully loading other files from the same directory. I opened the file in XML Spy, which immediately displayed a message to the effect that the XML was not well-formed. And sure enough, I had missed something. Here is what the XML looked like:

<page>
<name>page1</name>
<type>pagetype</type>
<previewUrl>previewUrl</previewUrl>
<path>page/path1</path>
<promoTypes>
</promoType>typeOne</promoType>
</promoType>typeN</promoType>
</promoTypes>
</page>
You will probably see the error right away, but to my embarrassment I didn’t. How did the error creep in? Well, I had copied the sample XML from the design document (which I did not write) and pasted it into an XML file so that I’d have something to pull in for development purposes, and evidently I did not check it over very carefully. (If you don’t see the error, look closely at the promoType tags, and you’ll see that the opening tags have closing slashes.)

I fixed the XML, the error vanished, and I was able to resume forward progress. Clearly, the error message displayed by the debug player was not only non-helpful, it was actually misleading.

I thought I’d post this here in case anyone else runs into a similar problem. It may save you a few minutes of wonderment.
visit url:http://hi.baidu.com/zcq100/blog/item/de12ec1f93f85b69f724e434.html
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值