<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    果子的程序人生

    Spring blazeDS Integration destination not exists異常解決

    環(huán)境:
    • Spring blazeDS Integration 1.0.0 release
    • blazeDS 3.2.0.3978
    • jdk1.6.0_06
    • flex sdk 3.2.0
    • flex builder 3
    在web.xml中配置DispatcherServlet
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns
    ="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
        xsi:schemaLocation
    ="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
        id
    ="WebApp_ID" version="2.5">
        
    <display-name>flex_server</display-name>
        
    <context-param>
            
    <param-name>contextConfigLocation</param-name>
            
    <param-value>/WEB-INF/context-*.xml</param-value>
        
    </context-param>
        
    <listener>
            
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        
    </listener>
        
    <servlet>
            
    <servlet-name>flex</servlet-name>
            
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
            
    <load-on-startup>1</load-on-startup>
        
    </servlet>
        
    <servlet-mapping>
            
    <servlet-name>flex</servlet-name>
            
    <url-pattern>/messagebroker/*</url-pattern>
        
    </servlet-mapping>
        
    <welcome-file-list>
            
    <welcome-file>index.html</welcome-file>
        
    </welcome-file-list>
    </web-app>

    在flex-servlet.xml中定義destination
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi
    ="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
        xmlns:tx
    ="http://www.springframework.org/schema/tx" xmlns:flex="http://www.springframework.org/schema/flex"
        xsi:schemaLocation
    ="http://www.springframework.org/schema/beans 
        http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context-2.5.xsd
        http://www.springframework.org/schema/tx
        http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
        http://www.springframework.org/schema/flex   
        http://www.springframework.org/schema/flex/spring-flex-1.0.xsd"
    >
        
    <flex:message-broker />
        <!-- premiumService是普通的業(yè)務(wù)bean -->
        
    <flex:remoting-destination ref="premiumService"/>
    </beans>

    這樣在remoting-config.xml中就不需要定義destination了
    <?xml version="1.0" encoding="UTF-8"?>
    <service id="remoting-service" 
        class
    ="flex.messaging.services.RemotingService">

        
    <adapters>
            
    <adapter-definition id="java-object" class="flex.messaging.services.remoting.adapters.JavaAdapter" default="true"/>
        
    </adapters>

        
    <default-channels>
            
    <channel ref="my-amf"/>
        
    </default-channels>
        
    <!--注釋掉,否則啟動(dòng)會(huì)報(bào)錯(cuò)或出現(xiàn)其他問題
        <destination id="premiumService">
            <properties>
                <source>org.hag.flex.service.PremiumService</source>
            </properties>
        </destination>
        
    -->
    </service>

    測試
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        creationComplete
    ="premiumService.getPremiumList()">
        
    <mx:Script>
            
    <![CDATA[
                <!-- 省略import -->
                private function resultHandler(evt:ResultHandler):void
                {
                    Alert.show(evt.result.toString());
                }
                private function faultHandler(evt:FaultHandler):void
                {
                    Alert.show(evt.fault.toString());
                }
            
    ]]>
        
    </mx:Script>
        
    <mx:RemoteObject id="premiumService" ref="premiumService"
            result
    ="resultHandler(event)" fault="faultHandler(event)"/>
    </mx:Application>

    結(jié)果這時(shí)候報(bào)錯(cuò),destination "premiumService" either does not exists....
    原因是mxml編譯時(shí)要根據(jù)remoting-config.xml來處理destination的定義,而我們把premiumService定義在了spring bean中,所以它根本就不知道premiumService的存在。取消掉remoting-config.xml的注釋,再次對(duì)mxml進(jìn)行編譯(如修改后保存),在瀏覽器中清除緩存、刷新,OK,結(jié)果出來了。

    注意在tomcat啟動(dòng)時(shí)又要把remoting-config.xml定義的destination注釋掉,否則會(huì)出問題。或者干脆在其他地方建立一個(gè)文件專門用于mxml的編譯。

    posted on 2009-07-04 00:41 果子 閱讀(873) 評(píng)論(1)  編輯  收藏 所屬分類: springjavaflex

    評(píng)論

    # re: Spring blazeDS Integration destination not exists異常解決 2009-11-12 00:34 hbbbs

    GOOD,我也碰到了這個(gè)問題  回復(fù)  更多評(píng)論   


    只有注冊用戶登錄后才能發(fā)表評(píng)論。


    網(wǎng)站導(dǎo)航:
     

    導(dǎo)航

    <2009年7月>
    2829301234
    567891011
    12131415161718
    19202122232425
    2627282930311
    2345678

    統(tǒng)計(jì)

    常用鏈接

    留言簿(1)

    隨筆分類

    隨筆檔案

    搜索

    最新評(píng)論

    閱讀排行榜

    評(píng)論排行榜

    主站蜘蛛池模板: 亚洲av无码专区在线播放| AV在线亚洲男人的天堂| 亚洲福利视频网址| 无码人妻一区二区三区免费n鬼沢| 区三区激情福利综合中文字幕在线一区亚洲视频1 | 免费福利电影在线观看| 亚洲av色影在线| 无码日韩精品一区二区免费暖暖 | 伊人久久亚洲综合影院首页| 亚洲电影在线免费观看| 亚洲国产情侣一区二区三区| 国产h视频在线观看免费| 亚洲日本乱码卡2卡3卡新区| 四虎成人免费影院网址| 美女又黄又免费的视频| 亚洲无av在线中文字幕| 久久久免费精品re6| 亚洲特级aaaaaa毛片| 四虎影视免费在线| 免费人成视频在线播放| 亚洲精品狼友在线播放| 亚洲免费观看网站| 亚洲AV一区二区三区四区| 亚洲高清免费视频| 今天免费中文字幕视频| 亚洲一区二区三区91| 国产又大又长又粗又硬的免费视频| 国产精品亚洲五月天高清| 亚洲人成色77777| 97精品免费视频| 亚洲国产精品ⅴa在线观看| 亚洲男人的天堂一区二区| 久久国产精品成人免费| 亚洲三级在线播放| 亚洲精品国产va在线观看蜜芽| a级毛片免费完整视频| 国产成人精品日本亚洲直接| 亚洲精品网站在线观看不卡无广告| 久热免费在线视频| 亚洲日韩精品无码专区| 亚洲中文字幕日产乱码高清app|