fx_IA
来源:互联网 发布:快速排序java实现 编辑:程序博客网 时间:2024/06/01 07:24
一、安装
1、ia安装---绿色版可用、可升级
2、apache-fx-sdk-installer-2.7.0-bin安装---安装目录要为空
如下载较慢,可查看安装界面上的install log,可得下载的真实地址
也可Apache Fx\Apache FxSDK Installer\installer\sdk-installer-config-3.1.xml,得到下载的真实地址
二、本地运行flex
1、新建flex项目,
project structure
---project,project SDK默认为空、输出目录默认为:E:\programing\flex\workSpaceTest\manTest\out
---modules,主类ManTest的输出目录为ManTest.swf、输出目录为:项目文件夹\out\production\manTest
(modules输出路径的优先级高于 project的)
2、edit configureation里,修改相应文件的 what to laugh为build output
三、fx输出到tomcat里
1、project structure,修改modules中的“output folder”到tomcat\webapps下,如:D:\webContainer\Tomcat 7.0\webapps\fx_manage(project中的输出目录默认)
2、edit configureation里,修改相应文件的 what to laugh---url or local file:http://127.0.0.1:8080/fx_manage/
--------问题,每个mxml需要配置一次edit configureation;输出目录必须在tomcat/webapps;需要自己手动启动tomcat,则会把tomcat/webapps下所有项目都启动
四、fx+tomcat
1、新建java项目,新建flex模块:Modules---new module---flash
设置flex模块的编译输出目录:project structure---artifacts---<output>,默认有web项目的输出(web-inf:classes、lib、web.xml;'web' directory contents等),绿色加号---module output---选择flex module(如不选,在项目的artifacts目录里没有flex的输出)
2、ide右上角新建tomcat配置(tomcat 的home和base directory内容一样)
(deployment只需要添加projectName:war exploded即可,然后修改application context为"\projectName"---如使用默认的“\”,则会发布到tomcat的根目录、浏览器默认使用\projectName访问提示404错误;
修改server---open brower中的url为http://localhost:8080/projectName),
测试jsp时,打开jsp,ide右上角选tomcat,绿色三角运行---IDEA会自动调用浏览器显示当前jsp
测试mxml时,打开激活mxml,ide右上角选tomcat,绿色三角运行---IDEA自动会调自动用浏览器显示默认页,需要手动输入url显示flex?
-----------上述配置,flex module编译后会在“项目文件夹\out\production\flex_client“ 输出一次(module output),然后会将 复制一份到 项目的artifact目录里(因为artifact里增加了flex module的输出),浪费、但java和flex均可使用右上角的tomcat配置编译、运行
也可直接将flex module的输出目录定位到 项目的artifact目录里,则flex可少输出一次(那不就和方法3一样了?)---flex要用右上角的flex配置 编译运行
2、新建flex项目,新建javaWeb模块--?
三、Ia+Blazed
参考:
GraniteDS Projects with IntelliJ IA 9
http://blog.jetbrains.com/idea/2009/11/graniteds-projects-in-maia/
1、新建项目,Java、flex模块;并根据fb下的教程编写代码、复制lib、配置web.xml
2、为flex模块的"server teachnology"增加 services-config.xml,flex data service config file要用绝对地址(教程上的相对路径不行,如project_name/...编译时会报错);
content root要用project_name(即访问时的项目名,直接写项目名、不加"\");
(services-config.xml里还需要修改提供数据的java类)
3、facet web一般在新建javaWeb模块时会自动添加:deployment descriptor使用默认设置、即指向java模块的web.xml;
web resource directories的配置与教程不同,web resource directory指向project_name\web,path relative to deployment root指向“/”即可
4、教程中后续可略
5、xhtml里id="testrds"报错:Error:(19, 0) Error code: 1046: Type was not found or was not a compile-time constant: Testrds.
或Error:(23, 39) Error code: 1017: The definition of base class RemoteObjectServiceWrapper was not found.
<fx:Declarations><!-- 将非可视元素(例如服务、值对象)放在此处 --><s:CallResponder id="callHelloResult" /><services:Testrds id="testrds" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/></fx:Declarations>
6、问题:
a、单击按钮,提示:Cannot invoke method 'callHello'.Method 'callHello' not found.
java类中的方法名与xxx 不同
b、Send failed... Channel.Connect.Failed error...Channel.Connect.Failed error NetConnection.Call.Failed 404 url...
http://127.0.0.1:8080/labEquipMan/messagebroker/amf...
1、正常情况浏览上述url,空白页面但不会报错;
2、检查发布目录的文件夹结构,即项目artifact的设置:如没有services-config.xml等配置文件、没有对应的java类,也会报此错
3、其它可能的原因:
a、services-config里写上项目名,http://blog.csdn.net/fitlife/article/details/7487499
b、services-config添加属性,http://blog.csdn.net/wuhualong1314/article/details/6574849
c、编译时 “未知错误”
八、设置
1、hibernate支持
新建java项目,勾选hibernate支持,选择hibernate-release-4.3.5.Final\lib\required下的所有jar
进入project structure可能会提示“artifact xxx :library 'hibernate xxx' required for module xxx is missing from the artifact”---进入artifact ,output layout,<output root>,在web-inf下新建lib目录,将右边aviliable element里的hibernate拖入lib
2、为fx增加lib目录
project structure---modules---选中flex项目---dependencies,下面默认有flex的sdk,绿色加号 增加lib的目录
3、发布正式release
project structure---module---compile options,generate debuggable》false,swf可以减小至40%
4、重装IA后打开FX项目
project structure---platform settings---SDKs,添加JDK、FX SDK
九、知识
1、modules(模块)、facets(方面)、artifacts(人造物品)
http://my.oschina.net/tsl0922/blog/94621 IntelliJ IDEA 12 与 Tomcat 集成并运行Web项目
Facets表示这个module有什么特征,如Web,Spring和Hibernate等。
artifact这个和maven的概念一下,就是这个module要产出什么,war,jar还是ear。
2、IntelliJ IDEA 目录技巧 http://www.blogjava.net/yifeng/archive/2008/08/27/224903.html
Ø在IntelliJ IDEA里面“new Project”就相当于我们eclipse的“workspace”,而“new Module”才是创建一个工程,这是要注意的一点。
Ø “Exploded”就是真正运行的目录,因为我们可以有多个“Module”,当在ide里面选择运行哪个“Module”的时候,环境将指定到哪里目录,
Ø IntelliJ IDEA不支持自动编译,也就是说不能像Eclipse那样,自动编译class,IntelliJ IDEA必须由我们Make进行。--------08年的文章,现在?
Ø IntelliJ IDEA不支持热发布,我们平常在Eclipse里面改页面的时候不需要启动容器,直接就能刷新过来了,但是IntelliJ IDEA不行,因为需要Make,和输出(out),
Ø 刚才说到,IntelliJ IDEA不支持热发布,就因为改个页面我们去重启容器,是很浪费时间的,也很麻烦。我们通过改变目录来解决这个问题。
在“Project Settings”里面“Modules”也就是我们工程的名字,然后把“Paths”设置到xxx\web-inf\classes
然后我们“Make Module“,发现文件都编译到classes下了。和我们以前的一样了吧。
3、官方
使用视屏:http://tv.jetbrains.net/channel/intellij-idea/flex
更新:http://www.jetbrains.com/devnet/idea/
4、输出目录结构
flex类型的module默认的输出目录为:project_name\out\production\module_name
javaWeb的module默认的输出目录、会继承和使用java project的compile目录;
当该模块绑定了article后,会使用article的输出目录,默认为project_name\out\artifacts\project_name_war_exploded---web服务器会直接加载该目录的内容(与服务器的安装目录没任何关系),并执行和显示
5、as有些类,不在SDK的lib里,可能在fb的目录内
如下代码,提示找不到fiber,可在fb4.5\eclipse\plugins\com.adobe.flexbuilder.project_4.7.0.349722\fiberSwcs\4.5\libs中找到
import com.adobe.fiber.core.model_internal;import com.adobe.fiber.services.wrapper.RemoteObjectServiceWrapper;import com.adobe.fiber.valueobjects.AvailablePropertyIterator;import com.adobe.fiber.services.wrapper.RemoteObjectServiceWrapper;
http://stackoverflow.com/questions/9216352/flashbuilder-4-5-mobile-no-com-adobe-fiber