Flex访问部署在JBoss4.2上的WebService时报错
detail: Destination: DefaultHTTP
message: Security error accessing url
rootCause: [SecurityErrorEvent type="securityError" bubbles=false cancelable=false eventPhase=2 text="Error #2170"]
需要给JBoss设置crossdomain.xml,将crossdomain.xml放到
jboss-4.2.3.GA\server\default\deploy\jboss-web.deployer\ROOT.war 目录中。
这样用 http://域名或IP:8080/crossdomain.xml 是可以访问到xml的
crossdomain.xml内容如下: 在FlashPlayer9和10中测试通过
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<site-control permitted-cross-domain-policies="all" />
<allow-access-from domain="*" to-ports="*" secure="false"/>
<allow-http-request-headers-from domain="*" headers="*" secure="false" />
</cross-domain-policy>
重启服务器后,问题解决
参考
http://technicalmumbojumbo.wordpress.com/2009/02/03/developing-a-flex-webservice-client/
http://curtismorley.com/2007/09/01/flash-flex-tutorial-how-to-create-a-crossdomainxml-file/
http://www.adobe.com/devnet/flashplayer/articles/fplayer9_security.html
本文介绍了当使用Flex访问部署在JBoss 4.2上的WebService时遇到的问题及解决方法。主要通过配置crossdomain.xml文件来解决跨域访问的安全错误问题。

被折叠的 条评论
为什么被折叠?



