Flex CrossDomain.xml 错误 - Channel.Security.Error 错误错误 #2048

发布于 2024-10-22 00:12:07 字数 1393 浏览 2 评论 0原文

我正在努力让 Flex SWF(嵌入在 JSP 中)访问远程数据(来自另一个域)。

我有一个 crossdomain.xml (它嵌入在我的 SWF 中)。其内容如下:

    <?xml version="1.0" encoding="UTF-8"?>
<cross-domain-policy>
    <site-control permitted-cross-domain-policies="all" />  
    <allow-access-from domain="*"/>
    <allow-http-request-headers-from domain="*" headers="*"/> 
</cross-domain-policy>

在我的 main.xml 中,我使用以下方法加载 crossdomain.xml 文件:

Security.loadPolicyFile("http://www.mysite.com:8380/CSS/ReviewItemsServer/crossdomain.xml");

当我通过浏览器访问 JSP 网页时,嵌入式 SWF 尝试执行 Java 远程调用,但出现以下错误:

Error string = Send failed
Error code = Client.Error.MessageSend
Error details = Channel.Security.Error error Error #2048: 
Security sandbox violation: http://www.mysite.com/CSS/ReviewItemsServer/ReviewItemsMain.swf 
cannot load data from http://www.mysite.com:8380/CSS/ReviewItemsServer/messagebroker/amf. url: 

I am beautiful确保 crossdomain.xml 文件实际上由 SWF 加载,因为我创建了一个简单的 URLLoader 来加载 xml 文件并检查是否没有错误。所以我不认为这是一个问题...

当我在调试模式下运行 SWF 时...我还看到以下错误消息:

Error: [strict] Ignoring policy file at http://www.mysite.com:8380/CSS/ReviewItemsServer/crossdomain.xml due to missing Content-Type.  See http://www.adobe.com/go/strict_policy_files to fix this problem.

任何帮助将不胜感激...

马克

I am struggling with getting a Flex SWF (which is embedded in JSP) to access remote data (from another domain).

I have a crossdomain.xml (which is embedded in my SWF). Its content is as follows:

    <?xml version="1.0" encoding="UTF-8"?>
<cross-domain-policy>
    <site-control permitted-cross-domain-policies="all" />  
    <allow-access-from domain="*"/>
    <allow-http-request-headers-from domain="*" headers="*"/> 
</cross-domain-policy>

In my main.xml I load the crossdomain.xml file using:

Security.loadPolicyFile("http://www.mysite.com:8380/CSS/ReviewItemsServer/crossdomain.xml");

When I access the JSP webpage via the browser, the embedded SWF tries to do a Java remoting call and I get the following error:

Error string = Send failed
Error code = Client.Error.MessageSend
Error details = Channel.Security.Error error Error #2048: 
Security sandbox violation: http://www.mysite.com/CSS/ReviewItemsServer/ReviewItemsMain.swf 
cannot load data from http://www.mysite.com:8380/CSS/ReviewItemsServer/messagebroker/amf. url: 

I am pretty sure that the crossdomain.xml file actually get loaded by the SWF as I have created a simple URLLoader to load the xml file and check that there is no error. So I dont think that is an issue...

When I run the SWF in debug mode...I also see the following error message:

Error: [strict] Ignoring policy file at http://www.mysite.com:8380/CSS/ReviewItemsServer/crossdomain.xml due to missing Content-Type.  See http://www.adobe.com/go/strict_policy_files to fix this problem.

Any help would be greatly appreaciated....

Mark

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

安静被遗忘 2024-10-29 00:12:07

您需要位于 http://www.mysite.com:8380/crossdomain.xml< 的主策略文件/a> 包含以下内容:

<?xml version="1.0" encoding="ISO-8859-1"?> 
<cross-domain-policy> 
  <site-control permitted-cross-domain-policies="all"/> 
</cross-domain-policy>

这将允许使用子目录中的跨域策略文件。

You need a master policy file at http://www.mysite.com:8380/crossdomain.xml with the following contents:

<?xml version="1.0" encoding="ISO-8859-1"?> 
<cross-domain-policy> 
  <site-control permitted-cross-domain-policies="all"/> 
</cross-domain-policy>

That will permit crossdomain policy files in subdirectories to be used.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文