A reader pinged me this weekend asking if it was possible to install Flex with ColdFusion. As it so happens, I had done it twice on Friday so the answer was a resounding yes. Just in case you don't know how to do it, here is the URL at Ado... err Macromedia:
Installing Flex on ColdFusion MX
A few notes....
First - the document says that you can install Macromedia Flex on the J22 version of ColdFusion MX. To me - this implies the version of CFMX you run on JRun4, WebShere, whatever. It does not imply the standalone version. Maybe I'm just reading it wrong. Either way, it does work perfectly fine with the "normal" version of CF.
Also - and I'm not so sure I'd recommend this - but the most difficult part of the process is updating the web.xml file. However, I found that once I had updated the web.xml on machine 1, I had no problems simply copying it over the web.xml file on machine 2 (after backing it up of course). That may save you some time if you had to install it more than once.
(And may I say again - I would really love it if MACR would simply make the Flex installer notice CF and offer to merge it right then and there. Or maybe I'm just too lazy?)
Archived Comments
Ray,
this is not what we wanted.Can u please explain specifically?
Copy the following files from the flextemp\flex\WEB-INF\lib directory to the ColdFusion MX cf_server_root\WEB-INF\lib directory:
flex-bootstrap.jar
commons-beanutils.jar
commons-collections.jar
flashgateway.jar files .
When I did above steps these two jar files(commons-beanutils.jar,commons-collections.jar) were already in cfmmx lib folder. Do I want to replace it?
2)Copy all assets required by your Flex application into the root directory of your deployed ColdFusion server instance. For example, if you deployed ColdFusion on JRun 4, the root directory of your deployed ColdFusion server instance might be C:\JRun4\servers\default\cfusion.
What exactly meant by "assets"??
1) Yes - you should replace those 2 jars. I backed up mine first though.
2) Ignore all of that.
Its not immediately obvious to me why you would want to merge the Flex web application with the ColdFusion web application since the release of ColdFusion 7 and the new "rich forms" features.
Although, rather than merge them, you can deploy the Flex war and ColdFusion war to the same J2EE server instance very easily. See:
http://www.newsarch.com/arc...
Woah ... Steven... I may be misreading you here... but I respectfully disagree with you - and in a big way. Let me reply to each point:
"Its not immediately obvious to me why you would want to merge the Flex web application with the ColdFusion web application since the release of ColdFusion 7 and the new "rich forms" features."
Are you saying Flex is the same as rich forms? I know you don't mean that - but it almost sounds like you are saying a CFMX7 person doesn't need Flex. Flex is _way_ beyond what is in CFMX7. (This is not to knock Rich Forms - I love em.) Speaking for myself - I didn't want to run another app server to do Flex dev. I wanted both CF+Flex tied to my local web server.
"Although, rather than merge them, you can deploy the Flex war and ColdFusion war to the same J2EE server instance very easily."
Yes, but remember, I'm talking about a "simple" CFMX install. Most people I know simply install CF as is and run it with IIS or Apache. They don't run it with JRun. This is how I have it running, and all my clients as well.
I think the best reason for integrating Flex and CFMX is being able to have the MXML and CFM files in the same directory structure. This gives you some sweet options for development, including JSP/CFMX/MXML along with the ability to include the Flex tag lib in your JSP and CFM pages. It's been working beautifully using IIS6 on Windows 2003 server.
What I wish is that if you have both a flex and CFMX license, you could essentially unlock the locked down bits of CFFORM. Imagine being able to use ALL the flex UI elements in a CFFORM.
FWIW, it's also possible to integrate Flex with BlueDragon/J2EE. I have done it, for the same reasons and benefits described above (just for testing purposes, using the available developer edition of Flex). And the steps are the same as described above for integrating it with the CFMX J2EE web app.
My comments were based on my experience with a few people before CFMX 7 who only really wanted to have nice flash widgets such as what is now CFCalendar, or flash forms that integrated with CF. In those cases, the scope of what they wanted to accomplish was much more narrow than what Flex has to offer.
By deploying the Flex and the CF wars to the same server instance, you can have the '/' context root handle .cfm/.cfc requests, and another context root to handle .mxml requests where the mxml swf data is provided by AMF calls to CFCs. In this configuration, you have all of Flex and all of CF on one J2EE server instance, one webserver connector, and data integration. Deploying the wars here is really quite easy.
As far as a simple "Server configuration" combined installation, yes I can understand the desire to have the most effortless installation possible. I'm usually of the mindset that I'll work with what I've got.
In my current experience, I think a lot more ColdFusion customers that I encounter are going for the multiserver JRun installation, perhaps almost as much as the Server Config.
Steven: In terms of your first para - I do agree with you.
As for your experience with server folks - I think we definitely move in different directions (grin). I think Macromedia feels that Flex will only be used by those customers (hence one of the reasons for the high price tag), so I guess I see the reason to not bother with a simpler installer for folks running CF as a simple server.
When I run one of flex example like http://localhost/dataModel/dataModel.mxml
I got an error"Webservice Fault"
"Could not load wsdl"
Well I just have intsalled FLex on normal CFMMX7 server. but none of my examples works perfectly.
when i run another example http://localhost/blogreader/blogreader.mxml, I got another erorr "
HTTP Service Fault:
Java.lang.RuntimeException: You are not allowed to acces the URL http://localhost/blogreader/blogreader.mxml vai this proxy. URL is not in the proxy's whitelist.
Please advise?
when i run another flex example http://localhost/flexstore/flexstore.mxml, I got another error :
Could not load WSDL
Server.java.lang.RuntimeException:Bad service name : FlexStoreCatalogWS.
please advice
Running the Flex examples requires more changes than just merging Flex with ColdFusion web applications, including adding webservice and httpservice mappings, and configuring the whitelist.
This technote shows how to do it with Flex 1.0 and CFMX 6.1, which can serve as a rough equivalent for Flex 1.5 and CFMX 7 I think:
http://www.macromedia.com/s...
Also see this blog entry for more on configuring the whitelist and setting up Webservice mappings:
Flex Store Application: A Web Service from ID to Implementation -
http://www.talkingtree.com/...
Thanks for responding to him, Steven!
In regards to merging the Flex samples, IMHO, the difficultly in doing that outweighs the minor usage usually associated with samples.
I suggest just dragging the samples.war to a new samples server (assuming you don't already have a samples server) and hot deploying. You usually don't want your samples in production anyways so it's much easier to just launch the samples server when you need it rather than cluttering up your production environment config files with unwanted servlets, services and so on, that you'll just remove later on.
Now all my flex examples working perfectly except those which requires WSDL, for example "Flex Store". It is showing "Could not load Wsdl" Error!!.
Even after adding all services(bean mapping) to server-config.wsdd.
Can anybody help me please.
Is it popssible for you to supply a copy of your web.xml so i can compare - find the spot i went wrong - as you said it is complex and i thing i got it wrong some where as the mxmxl dont show they just download.
Please send it via email.
Thanks
jet
Could you send me web.xml file so I can compare it with my own... I too have problems setting up Flex to run with CFMX7.
Thanks
nenad - I recently moved to a new PC, and no longer have my Flex integrated. If you send me an email in a few weeks though, I'm sure it will be done and I'll send you the file.
Does anyone have a working example of the web.xml for CFMX 7 standalone? I have installed it on CFMX 7 without Jrun4 in IIS6. I believe I have the web.xml file somewhat right, yet when I run mxml files, it states " Either the Macromedia application server is unreachable or it does not have a mapping to process this request.". It is there in it the web.xml, and I also have mapped .mxml in IIS, per the technote. Also SWF files dont load at all unless I remove the mapping in IIS.
Anyone have suggestions for me to try?
Please help. I have read every link I can find on the web regarding getting FLEX and CFM to work ahppily together. I am running IIS and although I have rebuilt my web.xml file over and over, I keep getting this error when I try and view a page that conatins CFM HTML and MXML code in it:
Exception Type: class java.lang.NoClassDefFoundError
Servlet Name: CfmServlet
As others have asked prior to me, does someone have a copy of a web.xml file that works?
Thanks,
Keith
This link might help some people:
http://www.cflex.net/showfi...
Keith
Hi,
Ray has sent me a while ago web.xml file as I too have had problems with integration, and I must say it works perfectly. Keith, if you still need it e-mail me and I'll send you the file. If it's OK with Ray.
Nenad - you can share my XML file, I don't mind.
Nenad or Ray, How do I get your email address? I'm obviously missing something here, but I can't find anywhere on this site that allows me to get your address or send you an email. I am definately in need of the file still.
Thanks,
Keith
Heh, we hide email addresses so spammers can't get to it. Keith, post a comment again with your email address in the comment. I'd make it 'spam safe' by doing something like.
My address is foo, followed by the at symbol, and the rest of my email address is goo.com.
My email address is cfdaddy, followed by the at symbol, and then hotmail.com.
Thanks again,
Keith
Hey,
I have been going through this very issue! May I also receive a copy of the web.xml file? Thanks much. My e-mail is saeedrichardson, followed by the at sign, followed by gmail.com (and if you want a gmail account I can send you one, too!).
Thanks again.
Well, the XML file does not seem to work either. I get the same errors I did before. I get this one right after I restart the CF service upon calling a CFM_mxml mixed page.
HTTP Status Code: 500
Exception Type: class java.lang.ExceptionInInitializerError
Servlet Name: CfmServlet
If I refresh, I get this one from that point on:
HTTP Status Code: 500
Exception Type: class java.lang.NoClassDefFoundError
Servlet Name: CfmServlet
I just went and rebuilt a new box and installed only CF and flex following the instruction and using the xml file with the exact same results. So now I've got two seperate servers with the same issue happening. One in a Win2K workstation, while the other is a Win2K Advanced Server, both of which are running IIS as the web server, CFMX 7, and FLEX 1.5.
Anybody have any other ideas I can try or know of an easy fix for this?
Thanks for everyones help,
Keith
Keith - this won't help much, but I'd suggest you do NOT start off by mixing MXML and CF. I'd build a simple "Hello World" MXML file and get that running first. In the past I've seen issues where I only got MXML files working, not both together. Obviously you want both working - but start simple.
Lastly - do not forget that if you are a paying customer for Flex, you can call MACR support. It may cost you money, but it would be a solution.
I have the same problem as Michael Tyler had. I have done everything by the book but when I try to run the app, it says "Either the Macromedia application server is unreachable or it does not have a mapping to process this request".
I haven't seen any solution to this problem on the thread so wondering if Michael was able to get it figured out.
Thanks
I actually just copyed the entire web.xml file:
http://www.cflex.net/Channe...
and replaced my orig one with it. It started to work after that. I went back and tweaked it a bit for what I was doing extra.
Michael,
Will you be able to tell me what steps did you take for the whole merger process from extracting the flex.war file to creating the mapping in IIS for .mxml and .swf?
I will appreciate that a lot
Thanks
Agha
1. Extract Flex - Default install extracts them to C:\Program Files\Macromedia\Flex\
2. Copy the entire C:\Program Files\Macromedia\Flex\flex\WEB-INF\flex\ to C:\CFusionMX7\wwwroot\WEB-INF\
so that you end up with C:\CFusionMX7\wwwroot\WEB-INF\flex\
Inside the C:\CFusionMX7\wwwroot\WEB-INF\flex\ folder you should end up looking like this:
C:\CFusionMX7\wwwroot\WEB-INF\flex\frameworks
C:\CFusionMX7\wwwroot\WEB-INF\flex\frameworks_debug
C:\CFusionMX7\wwwroot\WEB-INF\flex\jars
C:\CFusionMX7\wwwroot\WEB-INF\flex\system_classes
C:\CFusionMX7\wwwroot\WEB-INF\flex\user_classes
and with the follow files:
mxml-manifest.xml
gateway-config.xml
flex-config.xml
flash-unicode-table.xml
3. Copy the JAR files from C:\Program Files\Macromedia\Flex\flex\WEB-INF\lib\ to C:\CFusionMX7\wwwroot\WEB-INF\lib\
flex-bootstrap.jar
flashgateway.jar
commons-collections.jar
commons-beanutils.jar
### Backup your old ones first ####
4. I edited my web.xml file. I have a link you can download it from in a zip file:
http://www.abinidi.com/flex...
### backup your old one prior before edited anything ###
5. In IIS on the master site, I have mapped:
.mxml - C:\CFusionMX7\runtime\lib\wsconfig\jrun_iis6.dll
.swf - C:\CFusionMX7\runtime\lib\wsconfig\jrun_iis6.dll
Restarted CFMX and IIS
I hope this helps. I hope I didnt just get lucky getting it to run. If you have any questions, email me directly, and I can see what I may help with. abinidi@abinidi.com
I'm a bit late to the party but I tried the
http://www.cflex.net/Channe... version after the other changes referred to above
and just got a
"There is no web application configured to service your request" error
Michael's
http://www.abinidi.com/flex... no longer appears available
So Nenad/Ray could I try your version please (although this may not be the solution)
My address is agcur, followed by the at symbol, and the rest of my email address is rogers.com.
Thanks
Just reading this today. My vote is for doing what Steven is suggesting. I would even go a step farther and make Flex its own server. You then bring in Flex via Flash object tags. You use swf.mxml as the file suffix.
You will most likely need a crossdomain.xml to talk to the Flex server but that should not be a major issue.
Two reasons for this:
1. Enforces MVC architecture.
2. Upgrades between CF and Flex can be done independently.
Hi,
i have tried my best to get this CF MX7 and Flex integrated using the tutorials provided.
I worked through the one at : http://www.macromedia.com/s...
and i have done it to the letter IMHO. I am running a CF MX7 Enterprise (Devnet) edition server with integrated JRun server. I listed my system info at the bottom of the post.
I tried to run the mxml sample files using the following url:
http://localhost:8500/flexstore/flexstore.mxml
Am i right in trying to use the 8500 port (what CF is configued to listen on)?
I installed the Flex server with its own web server and i got the mxml files coming up no bother, then i hit a snag with the Web Services section of the tutorials (i did have a look at that article and it will help me)
I really am coming to the end of my patience as the whole process seems to not be working. Im wondering if i should just get the Flex running its own JRun web server, but I wanted to know if there are any benefits of merging the CF/Flex compilers/servers to work together under one server instance.
Any help would be appreciated!!!
my email is bazza_ni, the at symbol, hotmail dot com
Thanks,
Barry
-------------------------------------------------------------
CF MX7 Server System Information
Server Details
Server Product ColdFusion MX
Version 7,0,1,116466
Edition Enterprise (DevNet)
Serial Number
Operating System Windows XP
OS Version 5.1
JVM Details
Java Version 1.4.2_05
Java Vendor Sun Microsystems Inc.
Java Vendor URL http://java.sun.com/
Java Home e:\CFusionMX7\runtime\jre
Java File Encoding Cp1252
Java Default Locale en_GB
File Separator \
Path Separator ;
Line Separator Chr(13)
User Name SYSTEM
User Home C:\
User Dir e:\CFusionMX7\runtime\bin
Java VM Specification Version 1.0
Java VM Specification Vendor Sun Microsystems Inc.
Java VM Specification Name Java Virtual Machine Specification
Java VM Version 1.4.2_05-b04
Java VM Vendor Sun Microsystems Inc.
Java VM Name Java HotSpot(TM) Server VM
Java Specification Version 1.4
Java Specification Vendor Sun Microsystems Inc.
Java Specification Name Java Platform API Specification
Java Class Version 48.0
Java Class Path
CF Classpath
;e:/CFusionMX7/runtime/../lib/ant-launcher.jar;
e:/CFusionMX7/runtime/../lib/ant.jar;
e:/CFusionMX7/runtime/../lib/axis.jar;
e:/CFusionMX7/runtime/../lib/bcel.jar;
e:/CFusionMX7/runtime/../lib/cdo.jar;
e:/CFusionMX7/runtime/../lib/cdohost.jar;
e:/CFusionMX7/runtime/../lib/cf4was.jar;
e:/CFusionMX7/runtime/../lib/cf4was_ae.jar;
e:/CFusionMX7/runtime/../lib/cfmx-ssl.jar;
e:/CFusionMX7/runtime/../lib/cfusion.jar;
e:/CFusionMX7/runtime/../lib/commons-beanutils-1.5.jar;
e:/CFusionMX7/runtime/../lib/commons-collections-2.1.jar;
e:/CFusionMX7/runtime/../lib/commons-digester-1.3.jar;
e:/CFusionMX7/runtime/../lib/commons-discovery-0.2.jar;
e:/CFusionMX7/runtime/../lib/commons-discovery.jar;
e:/CFusionMX7/runtime/../lib/commons-logging-1.0.2.jar;
e:/CFusionMX7/runtime/../lib/commons-logging-api-1.0.2.jar;
e:/CFusionMX7/runtime/../lib/commons-net-1.2.2.jar;
e:/CFusionMX7/runtime/../lib/crystal.jar;
e:/CFusionMX7/runtime/../lib/flashgateway.jar;
e:/CFusionMX7/runtime/../lib/httpclient.jar;
e:/CFusionMX7/runtime/../lib/ib61patch.jar;
e:/CFusionMX7/runtime/../lib/ib6addonpatch.jar;
e:/CFusionMX7/runtime/../lib/ib6core.jar;
e:/CFusionMX7/runtime/../lib/ib6swing.jar;
e:/CFusionMX7/runtime/../lib/ib6util.jar;
e:/CFusionMX7/runtime/../lib/im.jar;
e:/CFusionMX7/runtime/../lib/iText.jar;
e:/CFusionMX7/runtime/../lib/iTextAsian.jar;
e:/CFusionMX7/runtime/../lib/izmado.jar;
e:/CFusionMX7/runtime/../lib/jakarta-oro-2.0.6.jar;
e:/CFusionMX7/runtime/../lib/java2wsdl.jar;
e:/CFusionMX7/runtime/../lib/jaxrpc.jar;
e:/CFusionMX7/runtime/../lib/jdom.jar;
e:/CFusionMX7/runtime/../lib/jeb.jar;
e:/CFusionMX7/runtime/../lib/jintegra.jar;
e:/CFusionMX7/runtime/../lib/ldap.jar;
e:/CFusionMX7/runtime/../lib/ldapbp.jar;
e:/CFusionMX7/runtime/../lib/log4j.jar;
e:/CFusionMX7/runtime/../lib/macromedia_drivers.jar;
e:/CFusionMX7/runtime/../lib/mail.jar;
e:/CFusionMX7/runtime/../lib/msapps.jar;
e:/CFusionMX7/runtime/../lib/pbclient42RE.jar;
e:/CFusionMX7/runtime/../lib/pbembedded42RE.jar;
e:/CFusionMX7/runtime/../lib/pbserver42RE.jar;
e:/CFusionMX7/runtime/../lib/pbtools42RE.jar;
e:/CFusionMX7/runtime/../lib/poi-2.5.1-final-20040804.jar;
e:/CFusionMX7/runtime/../lib/poi-contrib-2.5.1-final-20040804.jar;
e:/CFusionMX7/runtime/../lib/ri_generic.jar;
e:/CFusionMX7/runtime/../lib/saaj.jar;
e:/CFusionMX7/runtime/../lib/smack.jar;
e:/CFusionMX7/runtime/../lib/smpp.jar;
e:/CFusionMX7/runtime/../lib/STComm.jar;
e:/CFusionMX7/runtime/../lib/tools.jar;
e:/CFusionMX7/runtime/../lib/tt-bytecode.jar;
e:/CFusionMX7/runtime/../lib/vadmin.jar;
e:/CFusionMX7/runtime/../lib/verity.jar;
e:/CFusionMX7/runtime/../lib/vparametric.jar;
e:/CFusionMX7/runtime/../lib/vsearch.jar;
e:/CFusionMX7/runtime/../lib/wc50.jar;
e:/CFusionMX7/runtime/../lib/webchartsJava2D.jar;
e:/CFusionMX7/runtime/../lib/wsdl2java.jar;
e:/CFusionMX7/runtime/../lib/wsdl4j-1.5.1.jar;
e:/CFusionMX7/runtime/../lib/wsdl4j.jar;
e:/CFusionMX7/runtime/../lib/xalan.jar;
e:/CFusionMX7/runtime/../lib/xercesImpl.jar;
e:/CFusionMX7/runtime/../lib/xml-apis.jar;
e:/CFusionMX7/runtime/../lib/;
e:/CFusionMX7/runtime/../gateway/lib/examples.jar;
e:/CFusionMX7/runtime/../gateway/lib/;
e:/CFusionMX7/runtime/../wwwroot/WEB-INF/cfform/jars/batik-awt-util.jar;
e:/CFusionMX7/runtime/../wwwroot/WEB-INF/cfform/jars/batik-css.jar;
e:/CFusionMX7/runtime/../wwwroot/WEB-INF/cfform/jars/batik-ext.jar;
e:/CFusionMX7/runtime/../wwwroot/WEB-INF/cfform/jars/batik-transcoder.jar;
e:/CFusionMX7/runtime/../wwwroot/WEB-INF/cfform/jars/batik-util.jar;
e:/CFusionMX7/runtime/../wwwroot/WEB-INF/cfform/jars/commons-discovery.jar;
e:/CFusionMX7/runtime/../wwwroot/WEB-INF/cfform/jars/commons-logging.jar;
e:/CFusionMX7/runtime/../wwwroot/WEB-INF/cfform/jars/concurrent.jar;
e:/CFusionMX7/runtime/../wwwroot/WEB-INF/cfform/jars/flex.jar;
e:/CFusionMX7/runtime/../wwwroot/WEB-INF/cfform/jars/jakarta-oro-2.0.7.jar;
e:/CFusionMX7/runtime/../wwwroot/WEB-INF/cfform/jars/jcert.jar;
e:/CFusionMX7/runtime/../wwwroot/WEB-INF/cfform/jars/jnet.jar;
e:/CFusionMX7/runtime/../wwwroot/WEB-INF/cfform/jars/jsse.jar;
e:/CFusionMX7/runtime/../wwwroot/WEB-INF/cfform/jars/oscache.jar;
e:/CFusionMX7/runtime/../wwwroot/WEB-INF/cfform/jars/;
Server Classpath
e:\CFusionMX7\runtime\servers\lib;
e:\CFusionMX7\runtime\servers\lib\jrun-patch.jar;
e:\CFusionMX7\runtime\..\lib\macromedia_drivers.jar;
e:\CFusionMX7\runtime\lib\cfmx_mbean.jar;
e:\CFusionMX7\runtime\lib;
e:\CFusionMX7\runtime\lib\cfmx_mbean.jar;
e:\CFusionMX7\runtime\lib\instutil.jar;
e:\CFusionMX7\runtime\lib\java2wsdl.jar;
e:\CFusionMX7\runtime\lib\jrun-ant-tasks.jar;
e:\CFusionMX7\runtime\lib\jrun-xdoclet.jar;
e:\CFusionMX7\runtime\lib\jrun.jar;
e:\CFusionMX7\runtime\lib\jspc.jar;
e:\CFusionMX7\runtime\lib\migrate.jar;
e:\CFusionMX7\runtime\lib\oem-xdoclet.jar;
e:\CFusionMX7\runtime\lib\sniffer.jar;
e:\CFusionMX7\runtime\lib\webservices.jar;
e:\CFusionMX7\runtime\lib\wsconfig.jar;
e:\CFusionMX7\runtime\lib\wsdl2java.jar;
e:\CFusionMX7\runtime\lib\xmlscript.jar;
e:\CFusionMX7\runtime\lib\jrun.jar
Java Ext Dirs e:\CFusionMX7\runtime\jre\lib\ext