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

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

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

    人在江湖

      BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
      82 Posts :: 10 Stories :: 169 Comments :: 0 Trackbacks
    在學會了blazeds的簡單配置之后,今天嘗試了一下spring blazeds integration配置,被網上很多帖子坑了,比如這篇貌似不錯的:http://www.adobe.com/devnet/flex/articles/spring_blazeds_integration.html
    按照這篇文章的方式配置,會得到錯誤:
    [RPC Fault faultString="[MessagingError message='Destination 'XXXX' either does not exist or the destination has no channels defined (and the application does not define any default channels.)']" faultCode="InvokeFailed" faultDetail="Couldn't establish a connection to 'userService'"]
    在網上查原因,嘗試了3個多小時,才終于搞定,靠。
    第一步: 下載blazeds的sample, https://www.adobe.com/cfusion/entitlement/index.cfm?e=lc_blazeds 下載那個40多M的turnkey,里面包含tomcat和sample application.
    第二步:webapp目錄下有個blazeds目錄,這是做blazeds項目的一個基礎app, 新的app可以基于這個來做,lib目錄下已經包含相應的jar包了,一些configuration文件也都已經包括了??梢栽诋斍澳夸浽購椭普迟N出來一個副本,我命名為spring_blazeds。
    第三步:改web.xml,內容如下:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
        <display-name>BlazeDS</display-name>
        <description>BlazeDS Application</description>
    <servlet>
          <servlet-name>spring</servlet-name>
             <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
             <init-param>
                <param-name>contextConfigLocation</param-name>
                <param-value>/WEB-INF/web-application-context.xml</param-value>
             </init-param>
             <load-on-startup>1</load-on-startup>
       </servlet>
     
       <servlet-mapping>
           <servlet-name>spring</servlet-name>
           <url-pattern>/messagebroker/*</url-pattern>
       </servlet-mapping>
    </web-app>
    第四步:web-inf目錄下添加文件web-application-context.xml,內容如下:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:flex="http://www.springframework.org/schema/flex"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
    http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    http://www.springframework.org/schema/flex 
    http://www.springframework.org/schema/flex/spring-flex-1.0.xsd">
    <!-- Bootstraps and exposes the BlazeDS MessageBroker simplest form -->
    <flex:message-broker/>
     
       <bean id="productService" class="flex.samples.product.ProductService" >
          <flex:remoting-destination />
       </bean>
    </beans>
    第五步:
    把web-inf/flex目錄下的services-config.xml的前幾行改成:
    <?xml version="1.0" encoding="UTF-8"?>
    <services-config>
        <services>
            <default-channels>
                <channel ref="my-amf"/>
            </default-channels>
        </services>
    這一步非常重要,我好幾個小時沒搞定問題,主要差的就是這一步!web-inf/flex目錄下的其他文件沒用,至少在這個例子里沒用。
    第六步:
    寫mxml文件:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" backgroundColor="#FFFFFF">
    <mx:RemoteObject id="srv" destination="productService"/>
    <mx:DataGrid dataProvider="{srv.getProducts.lastResult}" width="100%" height="100%"/> 
    <mx:Button label="Get Data" click="srv.getProducts()"/>
    </mx:Application>
    第七步:
    把turnkey里blazeds-turnkey-4.0.0.14931\tomcat\webapps\samples\WEB-INF\src\flex\samples\product目錄下的java文件編譯一下,放web-inf的classes目錄下。
    第八步:
    添加jar包,編譯mxml,把bin-debug目錄下的所有文件包括history目錄都拷貝到webroot下,我的是spring_blazeds。記得編譯時加選項
    -services "C:\code\flex\blazeds-turnkey-4.0.0.14931\tomcat\webapps\spring_blazeds\WEB-INF\flex\services-config.xml" -locale en_US
    所以你每次改services-config.xml都要重新編譯,替換webapp的文件。

    然后運行應該就可以了!
    posted on 2013-06-07 15:08 人在江湖 閱讀(1927) 評論(0)  編輯  收藏

    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    主站蜘蛛池模板: 一级人做人爰a全过程免费视频| 亚洲精品高清国产一久久| 456亚洲人成影院在线观| 久久久久久久岛国免费播放| 国产亚洲精久久久久久无码| 在线人成免费视频69国产| 亚洲色成人中文字幕网站| 玖玖在线免费视频| 日本亚洲视频在线| 国产精品免费高清在线观看| 亚洲精品无码久久久久sm| 国产精品偷伦视频观看免费| 亚洲另类激情综合偷自拍 | 免费一级e一片在线播放| 黑人粗长大战亚洲女2021国产精品成人免费视频 | 亚洲精品在线网站| 四虎免费影院ww4164h| 亚洲天堂一区二区三区四区| 999久久久免费精品国产| 亚洲aⅴ天堂av天堂无码麻豆| 国产又粗又长又硬免费视频| eeuss草民免费| 好看的电影网站亚洲一区| 免费A级毛片无码A∨| 亚洲一区二区三区四区视频 | 国产成人免费片在线视频观看| 精品久久久久久亚洲中文字幕| 亚洲综合另类小说色区色噜噜| 免费高清国产视频| 久久综合久久综合亚洲| 亚洲av区一区二区三| 久久精品视频免费看| 亚洲色偷偷综合亚洲AV伊人蜜桃 | 国产免费MV大全视频网站| 久久久久亚洲AV片无码| 一区二区无码免费视频网站| 国产成人+综合亚洲+天堂| 亚洲AV本道一区二区三区四区| 最近中文字幕mv免费高清电影| 四虎影视久久久免费| 亚洲一区中文字幕久久|