Groups | Blog | Home
all groups > coldfusion flash integration > august 2005 >

coldfusion flash integration : Flash Remoting on CFMX7


CyberNaz
8/30/2005 9:41:17 AM
ok, its been three days and I have not been able to enable the Flash Remoting
on by CFMX7 Developer edition running on Windows XP SP2.

Running IIS though. CFM Apps work acceot Remoting doesn't. I type
http://localhost/flashservices/gateway and get error pages instead of blank as
mentioned in the docs... HELP !!!!!

Here is my gateway-config.xml text:

<?xml version="1.0" encoding="UTF-8"?>
<!--
Flash Remoting Gateway Configuration File - Version 1.2

This presence of this file overrides the legacy behavior of
the gateway. It allows the developer to customize which
services are available.

This file also introduces the concept of a basic whitelist
which allows the developer to restrict access to
particular classes and JNDI names.
-->
<gateway-config xmlns="http://www.macromedia.com/2004/gateway-config">

<!--
This list establishes which service adapters are enabled and
the order in which they are queried when searching for a supported service.
-->
<service-adapters>

<adapter>flashgateway.adapter.resultset.PageableResultSetAdapter</adapter>
<adapter>coldfusion.flash.adapter.ColdFusionAdapter</adapter>
<adapter>coldfusion.flash.adapter.CFCAdapter</adapter>
<adapter>coldfusion.flash.adapter.CFSSASAdapter</adapter>
<adapter
type="stateful-class">flashgateway.adapter.java.JavaBeanAdapter</adapter>
<adapter
type="stateless-class">flashgateway.adapter.java.JavaAdapter</adapter>
<adapter type="ejb">flashgateway.adapter.java.EJBAdapter</adapter>
<adapter
type="servlet">flashgateway.adapter.java.ServletAdapter</adapter>
<adapter>coldfusion.flash.adapter.CFWSAdapter</adapter>
</service-adapters>


<security>
<!-- The flashgateway.security.LoginCommand implementation used
to perform local authentication, depending on the application
server. -->
<login-command>
<class>flashgateway.security.JRunLoginCommand</class>
<server-match>JRun</server-match>
</login-command>

<!-- Stack traces are useful for debugging and product support, but
they should
not be sent to the client in "production mode" as they can expose
internal
information about the system. -->
<show-stacktraces>false</show-stacktraces>

<!-- A whitelist specifies which remote sources can be accessed
through the
gateway. The * character can be used as a wildcard to imply ALL
matches. -->
<whitelist>
<source>*</source>
</whitelist>
</security>

<!-- The flashgateway.log.Logger implementation used to redirect
logging information, depending on the application server. -->
<logger level="Error">coldfusion.flash.ColdFusionLogger</logger>

<!-- A redirect URL can be supplied to handle HTTP requests that were
not sent with AMF data -->
<redirect-url>{context.root}</redirect-url>

<!-- Determines how complex objects/generic class data types are to be
handled by the gateway. The two options are Classic or Flex.

Classic mode performs shallow serialization on all non-static fields
for classes implemeting java.io.Serializable.

Flex mode uses improvements made for Flex's RemoteObject feature
and performs deep serialization on fields with bean accessors for any
class. -->
<serialization>Classic</serialization>

<!-- ActionScript 1.0 and ColdFusion use case insensitive data structures
to store associative arrays, objects and structs - the Java representation
of these datatypes requires a case-insensitive Map, which the gateway
achieves by looking up all keys in lowercase. If case insensitivity is
desired
then this setting should be set to true. ActionScript 2.0 is now case
sensitive,
but setting this to true will allow ColdFusion to look up keys case
insensitively, and
will not actually change the case of the keys. For AS 2.0 to java this
should be false,
since both are case sensitive. -->
<lowercase-keys>true</lowercase-keys>

</gateway-config>

tzimmerman
8/30/2005 7:54:18 PM
Try the CFMX 7 http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=fd71533. See issue 59969 on that page.

HTH

CyberNaz
8/30/2005 8:14:27 PM
CyberNaz
9/1/2005 12:00:00 AM
Searched the web, nothing yet. But it does appear this obviously is a BIG bug
and Macromedia is hiding its face and not answering with a solution, coz they
got none.

I guess its time to downgrade to CFMX6.1 and possibly migrate to other
technologies. :(
PaulH
9/1/2005 6:13:54 AM
CyberNaz
9/1/2005 8:19:23 AM
I did run the reconnectors etc Remove_ALL_connectors.bat and IIS_connector.bat

PaulH
9/1/2005 8:25:14 AM
the rest of your cf stuff runs ok? hate to suggest it but maybe a clean start
w/cf7?

yes, jdk 1.5 is newer but i've heard that it might break remoting (it does
several other things like cfreport flashpaper).

CyberNaz
9/1/2005 8:29:51 AM
Everything else works great, except FlashRemoting. I don't mind clean start for
CFMX7. Does jdk1.5 come with the install? Or is it a seperate issue? Let me
know what can be done. Also how can I check what version jdk I am running?
PaulH
9/1/2005 8:36:14 AM
no, jdk 1.5 is something you have to add in your self. if you didn't
specifically point cf at that jvm then it's not the issue.

in standalone cfserver, you can use cfadmin/java to see which version you're
running. or look in jvm.config file for java.home value (the config file is
either in installedDrive\JRun4\bin\ for multiserver install or cfinstall\bin
for standalone....or something like that).
CyberNaz
9/1/2005 8:44:14 AM
This shows that I am on Java 1.4:

--------------------------------
System Information
Server Details
Server Product ColdFusion MX
Version 7,0,0,91690
Edition Developer
Serial Number Developer
Operating System Windows XP
OS Version 5.1
Update Level /C:/CFusionMX7/lib/updates/chf700003.jar
JVM Details
Java Version 1.4.2_05
Java Vendor Sun Microsystems Inc.
Java Vendor URL http://java.sun.com/
Java Home C:\CFusionMX7\runtime\jre
Java File Encoding Cp1252
Java Default Locale en_US
File Separator \
Path Separator ;
Line Separator Chr(13)
User Name SYSTEM
User Home C:\
User Dir C:\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
-------------------------------------------------------------

If I understand correctly you are suggesting that I should upgrade the Java to
1.5 and do a clean install? If that is correct I will do just that and will
post my results here.
PaulH
9/1/2005 9:01:03 AM
CyberNaz
9/1/2005 9:06:32 AM
tzimmerman
9/1/2005 12:43:59 PM
Try adding your own redirect-url to the gateway-config.xml file. See
http://livedocs.macromedia.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/
wwhelp.htm?context=ColdFusion_Documentation&file=00001479.htm.

Ted Zimmerman
CyberNaz
9/1/2005 6:20:58 PM
CyberNaz
9/2/2005 6:02:31 PM
Faadiel
9/3/2005 9:19:16 PM
OK enough is enough :) Post a sample of your CFC for me to take a look at.

Make 100% sure you add the following tags around your code like such...

<cfoutput>

mx.remoting.NetServices.setDefaultGatewayUrl("http://#cgi.HTTP_HOST#/flashservi
ces/gateway/");
var connection:mx.remoting.Connection =
mx.remoting.NetServices.createGatewayConnection();
var myService:mx.remoting.NetServiceProxy;
</cfoutput>

It must have the <cfoutput> tags otherwise nothing will work. I struggled for
a long while with that piece.

Also hit your server url http://localhost/flashservices/gateway/

if you get a blank page youre ok otherwise your install is screwed up. Also
make sure enable Remoting in the .ini files.

Hope this helps.
Brendan Rehman
Tampa Bay CF Users Group
CyberNaz
9/5/2005 8:39:54 PM
I have not been able to enable the FlashRemoting to begin with, forget about
the code...

Also hit your server url http://localhost/flashservices/gateway/
That I already have tried a million times and this is exactly what the problem
is... Error pages after error pages... I don't know of any .INI files that will
enagle your remoting, gateway-config.xml is the only one that deals with crap.

At this point I have dumped CFMX7 and already have migrated to a different
technology. Thanks for your help anyway.
CyberNaz
9/7/2005 7:10:35 AM
pdrich
9/9/2005 12:00:00 AM
CyberNaz
9/10/2005 12:00:00 AM
CFMX7 comes with remoting but it is not turned on by default. Make sure
you uncomment the lines in gateway-config.xml in WEB-INF folder:

<service-adapters>
<adapter>flashgateway.adapter.resultset.PageableResultSetAdapter</adapter>
<adapter>coldfusion.flash.adapter.ColdFusionAdapter</adapter>
<adapter>coldfusion.flash.adapter.CFCAdapter</adapter>
<adapter>coldfusion.flash.adapter.CFSSASAdapter</adapter>
<adapter
type="stateful-class">flashgateway.adapter.java.JavaBeanAdapter</adapter>
<adapter type="stateless-class">flashgateway.adapter.java.JavaAdapter</adapter>
<adapter type="ejb">flashgateway.adapter.java.EJBAdapter</adapter>
<adapter type="servlet">flashgateway.adapter.java.ServletAdapter</adapter>
<adapter>coldfusion.flash.adapter.CFWSAdapter</adapter>
</service-adapters>

IMPORTANT: The regular test http://servername/flashservices/gateway in
CFMX7 always fails and never is an indictaion if the server's remoting
is enabled or not. The solution is download the following code at the
link below. Extract the files and run the file on your CFMX7 server. If
you see the results, you are good to go. If not, then do other tests.
Let me know if this works.

http://www.asfusion.com/blog/examples/item/remoting-for-coldfusion-flash-forms
PaulH
9/11/2005 12:00:00 AM
that's not correct. cf7 comes with flash remoting turned on by default. what's not on by default are the webservice and java adapters.
CyberNaz
9/11/2005 11:39:40 PM
regardless whats enabled or not by default, the confusion has been removed...
Only if MM had mentiond the tiny fact that the flashservices/gateway URL is not
a good test. For the new CFMX7 users this info would have been helpful. I know
a lot of people are trapped in that test and haven't tested it otherwise, this
is a good one for them...

Cheers !
pdrich
9/12/2005 12:00:00 AM
CyberNaz, I downloaded the code you suggested. The form appeared, but clicking
the button had no effect (no change in display, no error message). I am
running this on HTTPS. When I changed the connection in the CFM file to
"https://#...", I then got the error while calling CFC and it wasn't found.
Any ideas?
Thanks
pdrich
9/12/2005 12:00:00 AM
Qais
9/13/2005 12:00:00 AM
PaulH,

"what's not on by default are the webservice and java adapters" !!! , are you
serious ?! , I've spent 2 months trying to connect to .NET web service using CF
MX 7 but I couldn't , at the end I used a COM object to connect to that web
service.

Qais
9/13/2005 12:00:00 AM
I know it is about flash remoting , I was just reading it by chance , question
: why didn't Macromedia told us what is enabled by default and what is not ?.
The second question , how to enable the web service ? or I have to open new
thread ?.
PaulH
9/13/2005 12:00:00 AM
its about flash remoting connecting to cf/webservices/java. not about cf connecting to webservices or vice versa.

PaulH
9/13/2005 6:28:58 AM
Jason Lim
9/25/2005 6:39:04 PM
Originally posted by: pdrich
I had to change the path to the CFC.

Could you please elaborate more what you did... as for me, still getting the
error while calling cfc.
Any idea to get it to work? what I know is the directory
"http://#cgi.HTTP_HOST#/flashservices/gateway/" don't even exist!

Thanks in advance
Jason
CyberNaz
9/26/2005 12:00:00 AM
flashservices/gateway directory doesn't exist physically... Do you have any
virtual folders? If so locate the diretory where JRunScripts is installed as an
Application for the server. There is a good article about how to run batches to
fix that problem also. Shoot... its linked somewhere in this thread...
pdrich
9/26/2005 12:00:00 AM
Jason,
The path to the CFC in my ColdFusion code was incorrect. For example, the
code in the calling page, <cfinvoke component="boodir.com.map"...> should point
to a map.cfc file in mywebroot > boodir > com. I had to change the path in the
component attribute to match the actual path to the cfc on our server.
Jason Lim
9/27/2005 6:34:43 PM
The production server actually running without any problem which is on top of
IIS.
The problem is my development CFMX7 installed on XP Pro with the build-in web
server.
Should I do a clean install on IIS instead? I'd been searching around but get
nothing.

Anyone successfully running the flash remoting on the build-in web server?
please help.

AddThis Social Bookmark Button