Several of you have contacted me with problems using Flex beta 2 to connect to ColdFusion via Flash Remoting. A couple of the issues turned out to be configuration problems in flex-enterprise-services.xml (installed under WEB-INF\flex, and needed by the Flex compiler). Here is the file as it works for me:
<?xml version="1.0" encoding="UTF-8"?>
<services-config xmlns="http://www.macromedia.com/2005/flex-service-config">
<services>
<service id="coldfusionsamples-service"
class="flex.messaging.services.RemotingService"
messageTypes="flex.messaging.messages.RemotingMessage">
<adapters>
<adapter-definition id="cf-object" class="coldfusion.flash.messaging.ColdFusionAdapter" default="true"/>
</adapters>
<destination id="ColdFusion">
<channels>
<channel ref="my-cfamf"/>
</channels>
<properties>
<source>*</source>
<!-- define the resolution rules and access level of the cfc being invoked -->
<access>
<!-- Use the ColdFusion mappings to find CFCs, by default only CFC files under your webroot can be found. -->
<use-mappings>false</use-mappings>
<!-- allow "public and remote" or just "remote" methods to be invoked -->
<method-access-level>remote</method-access-level>
</access>
<property-case>
<!-- cfc property names -->
<force-cfc-lowercase>false</force-cfc-lowercase>
<!-- Query column names -->
<force-query-lowercase>false</force-query-lowercase>
<!-- struct keys -->
<force-struct-lowercase>false</force-struct-lowercase>
</property-case>
</properties>
</destination>
</service>
</services>
<security>
<login-command class="flex.messaging.security.JRunLoginCommand" server="JRun"/>
</security>
<channels>
<channel-definition id="my-cfamf" class="mx.messaging.channels.AMFChannel">
<endpoint uri="http://localhost:8500{context.root}/flex2gateway/" class="flex.messaging.endpoints.AMFEndpoint"/>
<properties>
<polling-enabled>false</polling-enabled>
<serialization>
<custom-deserializer type="typed-object" class="coldfusion.flash.messaging.io.amf.serializers.TypedObjectDeserializer" />
</serialization>
</properties>
</channel-definition>
</channels>
<logging>
<target class="flex.messaging.log.ConsoleTarget" level="Debug">
<properties>
<prefix>[Flex] </prefix>
<includeDate>false</includeDate>
<includeTime>false</includeTime>
<includeLevel>false</includeLevel>
<includeCategory>false</includeCategory>
</properties>
<filters>
<pattern>Endpoint.*</pattern>
<pattern>Service.*</pattern>
<pattern>Configuration</pattern>
<pattern>Message.*</pattern>
</filters>
</target>
</logging>
<system>
<locale>
<default-locale>en</default-locale>
<supported-locale>de</supported-locale>
<supported-locale>fr</supported-locale>
<supported-locale>es</supported-locale>
</locale>
<redeploy>
<enabled>true</enabled>
<watch-interval>20</watch-interval>
<watch-file>{context.root}/WEB-INF/flex/flex-enterprise-services.xml</watch-file>
<touch-file>{context.root}/WEB-INF/web.xml</touch-file>
</redeploy>
</system>
</services-config>
If you are not using ColdFusion's integrated HTTP server, be sure to change the port from 8500 (or just drop the port altogether if using port 80).
http://www.drisgill.com/index.cfm/2006/3/22/Flex-2...
--- Ben
Error: faultCode:Client.Error.MessageSend faultString:'Send failed' faultDetail:'Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 500'
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultH...()
at flash.events::EventDispatcher/dispatchEvent()
at mx.messaging::MessageAgent/fault()
at mx.messaging::Producer/fault()
at mx.messaging::ChannelSet/::faultPendingSends()
at mx.messaging::ChannelSet/handleChannelFault()
at flash.events::EventDispatcher/dispatchEvent()
at mx.messaging::Channel/mx.messaging:Channel::connectFailed()
at mx.messaging.channels::NetConnectionChannel/mx.messaging.channels:NetConnectionChannel::connectFailed()
at mx.messaging.channels::AMFChannel/mx.messaging.channels:AMFChannel::statusHandler()
Took me a while to figure out what was wrong, but when I checked the Coldfusion logs (JRUN4\logs\cfusion-event.log) i noticed the required JVM was not installed. The one that comes with JRUN4 apparently does not meet the required version.
I installed JAVA SDK 1.4.2.11, changed the JVM in the JRUN administrator, restarted server and everything started working ;-)
Also note that I changed the <endpoint> into: http://{context.root}/flex2gateway/
That way I am able to connect from any PC on the network.
Hope this helps,
Muzak
<endpoint uri="{context.root}/flex2gateway/" class="flex.messaging.endpoints.AMFEndpoint" />
Error: faultCode:Client.Error.MessageSend faultString:'Send failed' faultDetail:'Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 500'
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultH...()
at flash.events::EventDispatcher/dispatchEvent()
at mx.messaging::MessageAgent/fault()
at mx.messaging::Producer/fault()
at mx.messaging::ChannelSet/::faultPendingSends()
at mx.messaging::ChannelSet/handleChannelFault()
at flash.events::EventDispatcher/dispatchEvent()
at mx.messaging::Channel/mx.messaging:Channel::connectFailed()
at mx.messaging.channels::NetConnectionChannel/mx.messaging.channels:NetConnectionChannel::connectFailed()
at mx.messaging.channels::AMFChannel/mx.messaging.channels:AMFChannel::statusHandler()
Here is my services entry
--services=y:\CFusionMX7\wwwroot\WEB-INF\flex\flex-enterprise-services.xml
I have a mapped drive from my laptop to the webserver and I am using Flexbuilder on my laptop not the webserver.
My web site runs from the follwoing directory
I:\inetpub\wwwroot
Here is my endpoint from the enterprise-services.xml file
<endpoint uri="http://localhost{context.root}/flex2gateway/" class="flex.messaging.endpoints.AMFEndpoint"/>
I have tried the following also:
<endpoint uri="http://{context.root}/flex2gateway/" class="flex.messaging.endpoints.AMFEndpoint"/>
<endpoint uri="{context.root}/flex2gateway/" class="flex.messaging.endpoints.AMFEndpoint"/>
<endpoint uri="http://localhost:80{context.root}/flex2gateway/" class="flex.messaging.endpoints.AMFEndpoint"/>
<endpoint uri="http://intratest:80" target="_blank">http://intratest:80{context.root}/flex2gateway/" class="flex.messaging.endpoints.AMFEndpoint"/>
<endpoint uri="http://intratest{context.root}/flex2gateway/" class="flex.messaging.endpoints.AMFEndpoint"/>
Any ideas on what the error is from...I am trying to run the Phones sample project. All the project files are located in I:\inetpub\wwwroot\CFIDE\samples\Phones
Thanks for any help you can provide.
Ed
Thanks
04/18 15:05:27 user failed to load: flex.messaging.MessageBrokerServlet
04/18 15:05:27 error Invalid endpoint port '' specified for channel definition 'my-cfamf'.
[1]flex.messaging.config.ConfigurationException: Invalid endpoint port '' specified for channel definition 'my-cfamf'.
at flex.messaging.config.ApacheXPathConfigurationParser.channelDefinition(ApacheXPathConfigurationParser.java:355)
at flex.messaging.config.ApacheXPathConfigurationParser.channelsSection(ApacheXPathConfigurationParser.java:315)
at flex.messaging.config.ApacheXPathConfigurationParser.parseTopLevelConfig(ApacheXPathConfigurationParser.java:130)
at flex.messaging.config.ApacheXPathConfigurationParser.parse(ApacheXPathConfigurationParser.java:71)
at flex.messaging.config.ApacheXPathConfigurationParser.parse(ApacheXPathConfigurationParser.java:61)
at flex.messaging.config.ConfigurationManager.getMessagingConfiguration(ConfigurationManager.java:52)
at flex.messaging.MessageBrokerServlet.init(MessageBrokerServlet.java:54)
at coldfusion.bootstrap.ClassloaderHelper.initServletClass(ClassloaderHelper.java:96)
at coldfusion.bootstrap.BootstrapServlet.init(BootstrapServlet.java:48)
at jrun.servlet.WebApplicationService.loadServlet(WebApplicationService.java:1242)
at jrun.servlet.JRunRequestDispatcher.init(JRunRequestDispatcher.java:748)
at jrun.servlet.JRunRequestDispatcher.<init>(JRunRequestDispatcher.java:98)
at jrun.servlet.WebApplicationService.getDispatcher(WebApplicationService.java:865)
at jrun.servlet.ServletEngineService$1.fetch(ServletEngineService.java:511)
at jrunx.util.Cache.get(Cache.java:116)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:537)
at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:204)
at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:318)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:426)
at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:264)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
[0]javax.servlet.ServletException: Invalid endpoint port '' specified for channel definition 'my-cfamf'.
at coldfusion.bootstrap.ClassloaderHelper.initServletClass(ClassloaderHelper.java:104)
at coldfusion.bootstrap.BootstrapServlet.init(BootstrapServlet.java:48)
at jrun.servlet.WebApplicationService.loadServlet(WebApplicationService.java:1242)
at jrun.servlet.JRunRequestDispatcher.init(JRunRequestDispatcher.java:748)
at jrun.servlet.JRunRequestDispatcher.<init>(JRunRequestDispatcher.java:98)
at jrun.servlet.WebApplicationService.getDispatcher(WebApplicationService.java:865)
at jrun.servlet.ServletEngineService$1.fetch(ServletEngineService.java:511)
at jrunx.util.Cache.get(Cache.java:116)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:537)
at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:204)
at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:318)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:426)
at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:264)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
any ideas?
The flex-enterprise-services.xml file looks quite different to the one above.
There is no mention of the coldFusion service in there.
Can anyone post a good copy from Flex2 Beta3 for me please?
Kevin
I just installed Flex 2, and have data connectivity between Flex and WebServices (CFC's). If I try to convert to using Flash Remoting I get the errors listed here. I have tried every configuration that I have found on the web but so far it has not worked. Any insight you may have would be a great help to me. I am new to Flex, but so far I am really enjoying how easy it is to program.
Are you using a locla CF server running 7.0.2? You should not need to worry about the issues raised in this thread in the final product. So long as Flex Builder can find the CF services-config.xml it should just work. This thread applied to the beta when stuff was not as simple.
--- Ben
[RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Failed"]
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultH...()
at mx.rpc::Responder/fault()
at mx.rpc::AsyncRequest/fault()
at mx.messaging::ChannelSet/::faultPendingSends()
at mx.messaging::ChannelSet/channelFaultHandler()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.messaging::Channel/mx.messaging:Channel::connectFailed()
at mx.messaging.channels::PollingChannel/mx.messaging.channels:PollingChannel::connectFailed()
at mx.messaging.channels::AMFChannel/mx.messaging.channels:AMFChannel::statusHandler()
--- ben
Thanks!
Here's snippet from C:\CFusionMX7\wwwroot\WEB-INF\flex\services-config.xml:
The file originally contained:
uri="http://{server.name}:{server.port}{context.root}/flex2gateway/"
I changed it to:
1. uri="http://localhost:8500{context.root}/flex2gateway/
2. uri="http://localhost{context.root}/flex2gateway/
Still no luck. Please help! Thanks.
If anyone runs into a Flex gateway 404 error, I suggest looking at the link below. It solved my gateway problem and I was able to launch my first Flex application.
http://www.drisgill.com/index.cfm/2006/3/22/Flex-2...
Thanks RD!
Ben, I would like to thank you for supplying the public with a useful and detailed blog. I have solved many of problems here!