Flex Data Service + Eclipse WTP + Hibernate + MySQL開發環境配置

來源:互聯網
上載者:User

一、下載並安裝fds2,flex builder 2, wtp1.5,MySQL5.0

二、在eclipse wtp中建立WEB項目
1、在eclipse wtp項目[wtp project]/WebContent/WEB-INF/lib中添加:
(1)[fds2]/jrun4/servers/default/flex/WEB-INF/lib目錄中的
backport-util-concurrent.jar
commons-codec.jar
commons-httpclient.jar
commons-logging.jar
concurrent.jar
flex-bootstrap.jar
flex-messaging-common.jar
flex-messaging-opt.jar
flex-messaging-req.jar
flex-messaging.jar
(2)[fds2]/resources/hibernate目錄中的
antlr-2.7.5H3.jar
asm-attrs.jar
asm.jar
cglib-2.1.2.jar
commons-collections-2.1.1.jar
dom4j-1.6.1.jar
ehcache-1.1.jar
hibernate3.jar

2、將MySQL驅動程式mysql-connector-java-3.1.12-bin.jar添加到
[jboss]/server/default/lib

3、將[fds2]/jrun4/servers/default/flex/WEB-INF/flex中的預設設定檔添加到
[wtp project]/WebContent/WEB-INF/lib/flex

4、添加hibernate
(1)在src目錄中添加hibernate.cfg.xml
(2)在src目錄中建立.java和.hbm.xml檔案

5、在WebContent/WEB-INF/lib/flex/data-management-config.xml配置destination。

6、在J2EE透視圖的Servers視圖中,啟動伺服器,打包發布。

二、建立flex data service項目
有兩種選擇:一是將fds項目的輸出放在wtp項目中,在wtp項目中統一打包部署。
二是建立獨立的fds項目,好處是在fds項目中修改後,不需要重新部署即可使用。
建議在開發時使用第二種方式,在部署時使用第一種方式。下面是第二種方式的介紹:
1、在[jboss]/server/default/deploy目錄中建立新目錄flexclient.war。

2、在FlexBuilder中建立Flex Project,選擇Flex Data Services和Complie application
locally in Flex Builder,即在本地編譯項目。
下一步,
Root folder:[eclipse workspace]/flexserver/WebContent
Root URL:http://localhost:8080/flexclient
下一步,命名項目,使用預設位置。
下一步,Main source folder->browse->new->OK,建立一個src源檔案夾。
Output folder URL:[jboss]/server/default/deploy/flexclient.war/[fds project name]

3、添加data service庫,項目->右鍵->properties->Flex Build Path->Library Path->Add SWC
->browse->[fds2]/flex_sdk_2/frameworks/libs/fds.swc 

4、編寫程式,啟動

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.