Help with Flash Remoting

Scenario
I have a Server 2016 set up wth 2 sites; one with a PHP app serving out flash objects and a second site (using Coldfusion) with a load of code for Flash Remoting called by the Flash objects.
I have installed Lucee on a new server. The flash remoting appears to work on 127.0.0.1:8888 and I need to know how to get IIS to send the flash remoting requests to the right place, and where to put all the code for the remote calls. I installed ISAPI redirect to redirect to Tomcat for the CFC files (which works) but that’s not helping with the flash remoting calls.
Can anyone provide some pointers?

Do you get a white screen when you visit: 127.0.0.1:8888/flex2gateway

If yes - you should be good to go – if not, do a google search for Railo flex2gateway – you should find threads to get you going.

Post back if you run into a dead end

Yes, I get a blank screen. I got one of the developers to set up a test SWF and this is what I get back from the remoting call. The FRTest.cfc file is in the root of the web site

/1/onStatusÿÿÿÿ


code[1] Server.Processing rootCausedetailsmessage[1]?No destination with id ‘FRTest’ is registered with any service.

Is there some difference with the way this works in CF?
I have to create a destination in remoting-config.xml ?
The destination id needs to be in the submitted remoting request?
NOTE: I have removed the {context.root} part from the channel definition but it still behaves the same with it

If I put “cs” (destination id) in the remoting request I get a null pointer exception because it can’t find something. Anything else gets me the "No destination with id ‘…’ message

services-config.xml

        <channel-definition id="classic-cfamf" class="mx.messaging.channels.AMFChannel">
            <endpoint uri="http://{server.name}:{server.port}/flashservices/gateway/" class="flex.messaging.endpoints.AMFEndpoint"/>
            <properties>
                <polling-enabled>false</polling-enabled>
                <serialization>
                    <instantiate-types>false</instantiate-types>
                </serialization>
            </properties>
        </channel-definition>

remoting-config.xml

<service id="remoting-service" 
    class="flex.messaging.services.RemotingService">
    <adapters>
        <adapter-definition id="cf-object" class="org.lucee.extension.net.flex.LuceeAdapter" default="true"/>
        <adapter-definition id="java-object" class="flex.messaging.services.remoting.adapters.JavaAdapter"/>
    </adapters>
	
    <default-channels>
        <channel ref="my-cfamf"/>
        <channel ref="classic-cfamf"/>
    </default-channels>

    <destination id="cs">
        <channels>
            <channel ref="classic-cfamf"/>
        </channels>
        <properties>
            <source>*</source>
        </properties>
    </destination>
</service>

We have this running in a Linux environment. We don’t require a destination in the remoting-config.xml

Do you have your web.xml configured with the MessageBrokerservlet with the location of the services-config.xml? e.g.

<servlet id="MessageBrokerServlet"><servlet-name>MessageBrokerServlet</servlet-name>
<description>Lucee Servlet for Flex Gateway</description>
<servlet-class>flex.messaging.MessageBrokerServlet</servlet-class>
<init-param><param-name>services.configuration.file</param-name>
<param-value>/WEB-INF/flex/services-config.xml</param-value>
</init-param>
<init-param><param-name>messageBrokerId</param-name>
<param-value>_default_</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>

what do you have in your services-config.xml & remoting-config.xml?
What you show here is the same as I have. I have tried removing the destination from the remoting config but it doesn’t change anything. I am starting to think the develper who’s doing the flash stuff isn’t putting the destination into the flash config right so it won’t work.

Attached are the configuration files off WEB-INF/flex

messaging-config.xml (506 Bytes) proxy-config.xml (938 Bytes) remoting-config.xml (711 Bytes) services-config.xml (7.3 KB)

thanks @pat.moody but this is the same as what I have. Could you also post your web.xml file from the lucee config level?
I have been bashing my head against this for 3 days now :frowning:

This is the output from the BlazeDS debug set here - I would be interested to see what you get on a successful call

    <logging>
        <target class="flex.messaging.log.ConsoleTarget" level="debug">
[BlazeDS]01/21/2020 09:46:57.216 [INFO] [Endpoint.General] Channel endpoint classic-cfamf received request.
[BlazeDS]01/21/2020 09:46:57.263 [DEBUG] [Endpoint.AMF] Deserializing AMF/HTTP request
Version: 0
  (Message #0 targetURI=FRTest.dataTest, responseURI=/1)
    (Array #0)
      [0] = (Object #1)
        tstNum = 0.0
        id = "ColdFusion"
        destination = "ColdFusion"
        service = "ColdFusion"
        extaTest = "example text being sent"

[BlazeDS]01/21/2020 09:46:57.289 [DEBUG] [Endpoint.AMF] Serializing AMF/HTTP response
Version: 0
  (Message #0 targetURI=/1/onStatus, responseURI=)
    (Object #0)
      code = "Server.Processing"
      rootCause = null
      details = null
      message = "No destination with id 'FRTest' is registered with any service."


from web.xml

<servlet id="CFMLServlet"><servlet-name>CFMLServlet</servlet-name>
<description>Lucee CFML Engine</description>
<servlet-class>lucee.loader.servlet.CFMLServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet id="RestServlet"><servlet-name>RestServlet</servlet-name>
<description>Lucee Servlet for RESTful services</description>
<servlet-class>lucee.loader.servlet.RestServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet id="MessageBrokerServlet"><servlet-name>MessageBrokerServlet</servlet-name>
<description>Lucee Servlet for Flex Gateway</description>
<servlet-class>flex.messaging.MessageBrokerServlet</servlet-class>
<init-param><param-name>services.configuration.file</param-name>
<param-value>/WEB-INF/flex/services-config.xml</param-value>
</init-param>
<init-param><param-name>messageBrokerId</param-name>
<param-value>_default_</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>
<servlet-mapping><servlet-name>CFMLServlet</servlet-name>
<url-pattern>*.cfm</url-pattern>
<url-pattern>*.cfml</url-pattern>
<url-pattern>*.cfc</url-pattern>
<url-pattern>/index.cfc/*</url-pattern>
<url-pattern>/index.cfm/*</url-pattern>
<url-pattern>/index.cfml/*</url-pattern>
</servlet-mapping>
<servlet-mapping><servlet-name>RestServlet</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
<servlet-mapping><servlet-name>MessageBrokerServlet</servlet-name>
<url-pattern>/flex2gateway/*</url-pattern>
<url-pattern>/flashservices/gateway/*</url-pattern>
<url-pattern>/messagebroker/*</url-pattern>
</servlet-mapping>

Some logging info for you:

[BlazeDS]Channel endpoint my-cfamf received request.
[BlazeDS]Deserializing AMF/HTTP request
Version: 3
  (Message #0 targetURI=null, responseURI=/12)
    (Array #0)
      [0] = (Typed Object #0 'flex.messaging.messages.RemotingMessage')
        source = "eventservice"
        operation = "getEventVersion"
        timeToLive = 0
        clientId = "F889B029-DD0B-F0AA-D90A-448FE33B5B70"
        body = (Array #1)
          [0] = "4B9FA712-F7FA-494A-84AB-665FBDF3EA89"
        timestamp = 0
        headers = (Object #2)
          DSEndpoint = null
          DSId = "F8899617-0F09-7984-0554-586D27173331"
        messageId = "ED6055A5-D009-BFB2-3ADA-CF2217AD6433"
        destination = "ColdFusion"

[BlazeDS]Adapter 'cf-object' called 'eventservice.getEventVersion(java.util.Arrays$ArrayList (Collection size:1)
  [0] = 4B9FA712-F7FA-494A-84AB-665FBDF3EA89
)'

[BlazeDS]Result: 'ASObject(384874370)....
....
[BlazeDS]Serializing AMF/HTTP response
Version: 3
  (Message #0 targetURI=/12/onResult, responseURI=)
    (Externalizable Object #0 'DSK')
      (Typed Object #1 'EventVersionVO')
        contact_name = ""
        images = (Externalizable Object #2 'flex.messaging.io.ArrayCollection')
          (Array #3)

Ok so this is a version 3 message, and the test code the developer gave produces version 0 messages. These look totally different. Not sure if this has helped but it’s great info thanks

Did you get this working amcss?
I have exact same setup & problem, driving me nuts!

Sorry for resurrecting this old thread!

Thanks for this @pat.moody this helped us get Flash remoting running on Lucee 6.

When we connect to our Adobe air app almost everything works except Lucee doesn’t like the named parameters inside an object. Send the parameters without the object, in order and it works.

So in AS3 remoteService.functionname.send(123) works okay ( no name )

But remoteService.functionname.send( {lid:123} ) doesn’t work and throws this error:
( This syntax works on CF11 the cffunction expects a parameter called lid, number )

Here’s the error it throws:

“java.lang.IllegalStateException: Can’t overwrite cause with lucee.runtime.exp.UDFCasterException: Invalid call of the function [getLogin_s_2024], first Argument [user] is of invalid type, Cannot cast Object type [Struct] to a value of type [string]”

The fix for this can be found here:
https://github.com/lucee/extension-flex/pull/7/commits/4f59cac58e80c6e897ea3a16855fc042efd4b253
We implemented in the relevant java file (it’s shown in the link). I updated it and then ran ant to build our own custom jar.

1 Like