找不到/messagebroker/amf 文件 No / messagebroker / amf documents
08月26th, 2006 — Dreamer 08月26 th, 2006 - Dreamer昨天晚上我想要学习Flex Data Service,没想到却碰到了一个难缠的问题。 Yesterday evening I want to learn Flex Data Service, but did not expect a tough encounter the problem. 我在MXML文件中声明了一个RemoteObject,然后尝试向FDS发出异步请求,但是却怎么也发送不出去。 I MXML document in a statement RemoteObject, and then try to FDS issued asynchronous request, but how has not sent out. 因为我设置了如果失败就弹出event.fault.faultString,所以它一直弹出“Send fail”的提示,而JRUN控制台则提示"Requested resource /messagebroker/amf file not found"。 Because if I failed to set up a pop-up event.fault.faultString, so it has pop-up "Send fail" tips, tips and JRUN console is "Requested resource / messagebroker / amf file not found". 我就去查帮助,然后检查自己的配置文件是否正确。 I went to check, and check their profile is correct. 然而我搞了一晚上也没有弄出个所以然来,依然提示“Send Fail”。 However, I engage in a night no弄出a Suoyi Ran, still tips "Send Fail". 我的destination设置和其他设置是完全没有错误的,都和FDS自带的例子一样,但是为什么我写的东西就出错呢? I set the destination and other settings is totally wrong, and the case of FDS its own, but why do I write on the wrong things? » 排除了人品问题之后,我就去flexcoders的邮件档案去找,那里可真是个好地方,里面有很多前辈提出的问题和解答。 Ruled out the character issue, I'll go flexcoders the mail file, there is really a good place, there are a lot of the older generation put the questions and answers. 因为我不太可能那么幸运,这种问题只有我自己碰到,在我郁闷之前一定有人比我先郁闷过了。 Because I am unlikely to be so lucky, the only question I have encountered in my depressed than I was before we had the first depressing. 我搜索了一下,并仔细查找,终于被我找到了解决方法。 I had to search and look carefully, I finally found a solution. 原邮件:http://www.mail-archive.com/flexcoders@yahoogroups.com/msg23215.html 原来,"Requested resource /messagebroker/amf file not found" 是因为编译的时候{context.root} 不会在Eclipse中被设定,如果你要使用Flex Builder在本地编译的话,就需要吧{context.root} 替换成你的程序的根路径,一般来说就是WEB-INF文件夹的父文件夹。 Original message: http://www.mail-archive.com/flexcoders @ yahoogroups.com/msg23215.html original, "Requested resource / messagebroker / amf file not found" because the compiler of (context. Eclipse root) will not be set, if you want to use Flex Builder in the local compiled, it will need it (context.root) you replace the procedure root path, as a general rule is that WEB-INF folder Father Folder.
原本在flex-config.xml中是有这么一项的: In the original flex-config.xml is such a:
<context-root>/flex</context-root> <context-root> / flex </ context-root>
但是Eclipse既然不识别,只好在service-config.xml中做如下更改: However, since the Eclipse not identify, but in the service-config.xml to do the following changes:
原配置中有这么一段: The original allocation of such paragraph:
<endpoint uri="http://{server.name}:{server.port}/ {context.root} /messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/> <endpoint uri = "http:// (server.name): (server.port) / (context.root) / messagebroker / amf" class = "flex.messaging.endpoints.AMFEndpoint & # 34; />
<properties>
<polling-enabled>false</polling-enabled> <polling-enabled> false </ polling-enabled>
</properties> </ properties>
</channel-definition> </ channel-definition>
<channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel"> <channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel">
<endpoint uri="https://{server.name}:9100/ {context.root} /messagebroker/amfsecure" class="flex.messaging.endpoints.SecureAMFEndpoint"/> <endpoint uri="https://{server.name}:9100/ {context.root} /messagebroker/amfsecure" class="flex.messaging.endpoints.SecureAMFEndpoint"/>
</channel-definition> </ channel-definition>
<channel-definition id="my-polling-amf" class="mx.messaging.channels.AMFChannel"> <channel-definition id="my-polling-amf" class="mx.messaging.channels.AMFChannel">
<endpoint uri="http://{server.name}:{server.port}/ {context.root} /messagebroker/amfpolling" class="flex.messaging.endpoints.AMFEndpoint"/> <endpoint uri = "http:// (server.name): (server.port) / (context.root) / messagebroker / amfpolling" class = "flex.messaging.endpoints.AMFEndpoint & # 34; />
<properties>
<polling-enabled>true</polling-enabled> <polling-enabled> true </ polling-enabled>
<polling-interval-seconds>8</polling-interval-seconds> <polling-interval-seconds> 8 </ polling-interval-seconds>
</properties> </ properties>
</channel-definition> </ channel-definition>
大家注意红色部分的{context.root}, 你只要把它改为你的程序根路径就可以了,你可以更改所有的channel,也可以只更改需要用到的channel。 Attention to the red part of the (context.root), as long as you put it to you the procedure can be the root path, you can change all the channel, can only change the need to use the channel. 比如,我用的是RemoteObject,而RemoteObject使用的是my-amf channel,我的程序根路径为flex。 For example, I use the RemoteObject, and RemoteObject using a my-amf channel, I root path for the procedure flex. 所以我就做了以下更改: So I made the following changes:
<endpoint uri="http://{server.name}:{server.port}/ flex /messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/> <endpoint uri="http://{server.name}:{server.port}/ flex /messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
<properties>
<polling-enabled>false</polling-enabled> <polling-enabled> false </ polling-enabled>
</properties> </ properties>
</channel-definition> </ channel-definition>
………………
更改之后就成功送出了~~哈哈~~~心旷神怡! Changes after sending a success. He ~ ~ ~ ~ ~ delightful! ! ! 不过这里还有一个问题,虽然我没有“Send Fail”,但是又出现了一个错误提示: “Unsupported major.minor version 49.0”。 But there is a problem here, although I do not have "Send Fail", but also suggested that there was a mistake: "Unsupported major.minor version 49.0". 这个错误是怎么出现的呢? This is how the error? » 很明显不再是配置的原因了,肯定是JAVA对象的问题。 Obviously the reason is no longer targeted, JAVA object is certainly the issue. 请教了别人后才知道,是由于JDK版本的缘故。 Ask someone else after that was due to JDK version of the reason. 记住: Remember:
FDS自带的JRUN是不支持最新的JDK1.5编译的Class文件的,如果你想要使用JAVA 对象连接后台数据的话,必须实用JDK1.4来编译你的JAVA文件! FDS onboard JRUN does not support the latest JDK1.5 Class compiled the document, if you want to use JAVA object linking background, it must be practical JDK1.4 to compile your paper JAVA! ! ! ! ! 好像也可以为JRUN打补丁,不过这个我就不太清楚了。 Seem to be fighting for JRUN patch, but this I do not quite clear.
现在我终于可以从后台取得数据了,接下来再写几个小例子,继续探索FDS。 Now I can finally get the data from the background, next to write several small example, continue to explore FDS.
本文链接: http://www.zhuoqun.net/html/y2006/199.html 转载请注明出处,谢谢。 This link: http://www.zhuoqun.net/html/y2006/199.html reprint please reference, thank you.
TrackBack引用地址: http://www.zhuoqun.net/html/y2006/199.html/trackback TrackBack used Address: http://www.zhuoqun.net/html/y2006/199.html/trackback



