<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一级免费视频| 亚洲免费中文字幕| 久久精品国产亚洲AV忘忧草18| 日本妇人成熟免费中文字幕| 亚洲AV无码一区二区三区牛牛| 女人18毛片水真多免费播放 | 一级一级一级毛片免费毛片| 亚洲国产精品综合久久网络| 国产精品永久免费| 亚洲精品高清久久| 我的小后妈韩剧在线看免费高清版| 亚洲人成网站在线观看播放青青| 免费毛片在线看片免费丝瓜视频| 亚洲人成色77777在线观看| 亚洲成A人片77777国产| 青柠影视在线观看免费高清| 亚洲熟妇无码久久精品| 日本免费福利视频| 国产精品99爱免费视频| 亚洲一区免费观看| 日本一道综合久久aⅴ免费| 国产一级一毛免费黄片| 亚洲国产精品yw在线观看| 四虎永久免费观看| 久久精品免费电影| 亚洲Av无码国产一区二区| 中文字幕人成人乱码亚洲电影| 精品熟女少妇a∨免费久久| 在线观看亚洲免费视频| 亚洲AV午夜成人片| 在线观看免费宅男视频| a级毛片视频免费观看| 亚洲综合色一区二区三区|