|
Mailing Lists
|
Home /
Groups /
Adobe Flex
Flash Remoting Call Timing Out
Author: Jamie Jackson
Short Link: http://www.houseoffusion.com/groups/flex/thread.cfm/threadid:1800#5619
Thanks, João, I had been trying both, and neither worked. As part of the fix in
my last post, I have indeed gone back to "cfc.AddressService"
Thanks again for your help!
Jamie
----- Excess quoted text cut - see Original Post for more -----
Author: Jamie Jackson
Short Link: http://www.houseoffusion.com/groups/flex/thread.cfm/threadid:1800#5618
The main app's Application.cfm was doing strange things in the context of an AMF
call, and causing misleading symptoms.
Here's what finally fixed it: I put a new Application.cfm in my (external) cfc
directory, and used <cfapplication name="myMainApp'sAppName" />. This way,
I'm using the main app's app variables (which are all I need from it), but I'm
disinheriting all the garbage that's in the main app's Application.cfm.
Thanks very much to both of you, as your help jumpstarted my change of tack!
Jamie
----- Excess quoted text cut - see Original Post for more -----
----- Excess quoted text cut - see Original Post for more -----
>
> > <use-mappings>true</use-mappings>
> >
----- Excess quoted text cut - see Original Post for more -----
----- Excess quoted text cut - see Original Post for more -----
----- Excess quoted text cut - see Original Post for more -----
...
----- Excess quoted text cut - see Original Post for more -----
org)
Author: João_Fernandes
Short Link: http://www.houseoffusion.com/groups/flex/thread.cfm/threadid:1800#5617
If you are loading as
http://myapp.localhost/cfc/AddressService.cfc?method=getStates you can't
use
<mx:RemoteObject id="addressService"
source="myapp.wwwroot.cfc.AddressService" ... but you should use instead
<mx:RemoteObject id="addressService" source="cfc.AddressService" ...
--
João Fernandes
Adobe Community Expert
http://www.onflexwithcf.org
http://www.riapt.org
Portugal Adobe User Group (http://aug.riapt.org)
Author: Jamie Jackson
Short Link: http://www.houseoffusion.com/groups/flex/thread.cfm/threadid:1800#5616
Wait, I think I might be on way towards fixing this. I think the symptoms were
misleading me as to the source of the problem. I'll post back with the resolution
if I fix it.
Jamie
----- Excess quoted text cut - see Original Post for more -----
> <!-- Use the ColdFusion mappings to find CFCs, by default only CFC
> files under your webroot can be found. -->
>
> <use-mappings>true</use-mappings>
>
> <!-- allow "public and remote" or just "remote" methods to be invoked
> -->
>
----- Excess quoted text cut - see Original Post for more -----
----- Excess quoted text cut - see Original Post for more -----
...
----- Excess quoted text cut - see Original Post for more -----
org)
Author: Jamie Jackson
Short Link: http://www.houseoffusion.com/groups/flex/thread.cfm/threadid:1800#5615
Thanks João and Rob.
Unfortunately, I think I already have the things in place that you mentioned. Let
me recap everything I've got. Please let me know if you see anything wrong, or if
you need to see anything else.
The following always times out from Flex, but works every time, right away, from
http://myapp.localhost/cfc/AddressService.cfc?method=getStates
Here are all the details I can think of:
My virtual host doc root is:
/var/www/apps/myapp/wwwroot/
My internal CFCs are here:
/var/www/apps/myapp/model/
And my remote CFCs (that serve as remote proxies for my internal CFCs) are here:
/var/www/apps/myapp/wwwroot/cfc/
My Flex app is here:
/var/www/apps/myapp/wwwroot/flex/
"/myapp" CF Mapping points here:
/var/www/apps/myapp
Here's the relevant bit from my remoting-config.xml file:
<access>
<!-- Use the ColdFusion mappings to find CFCs, by default only CFC files
under your webroot can be found. -->
<use-mappings>true</use-mappings>
<!-- allow "public and remote" or just "remote" methods to be invoked
-->
<method-access-level>remote</method-access-level>
</access>
My Flex RemoteObject is defined like this:
<!-- I've tried it with both myapp.wwwroot.cfc.AddressService and
cfc.AddressService -->
<mx:RemoteObject id="addressService"
source="myapp.wwwroot.cfc.AddressService"
destination="ColdFusion"
fault="faultHandler(event)"
>
<!-- This service's returned query has the following columns:
stateID,countryID,state,state_abbr
notice that it has a specific result handler -->
<mx:method name="getStates" result="resultHandler(event)"/>
</mx:RemoteObject>
And the method it calls looks like this:
<cffunction name="getStates" access="remote" output="false"
returntype="query">
<cfset var local = structNew() />
<cfscript>
local.states = querySim('
stateID,countryID,state,state_abbr
... snip ...
58|1|Wyoming|WY
');
return local.states;
</cfscript>
</cffunction>
----- Excess quoted text cut - see Original Post for more -----
Author: João_Fernandes
Short Link: http://www.houseoffusion.com/groups/flex/thread.cfm/threadid:1800#5614
Jamie,
cfcs don't need to be directly exposed under the webroot, I also use
your approach by putting them under some other folder and I also use
multiserver version. The only thing you'll need, like others mentioned,
is to set use mappings = true so the MessageBroker /flex2gateway
endpoint use any mappings used by that application.
Using Application.cfc you can use <cfset this.mappings['/model'] =
'/var/www/apps/myapp/model/'/> and then your remote project just have to
use invoke them using
createObject('component','model.pathToYourDesiredCFC');
--
João Fernandes
Adobe Community Expert
http://www.onflexwithcf.org
http://www.riapt.org
Portugal Adobe User Group (http://aug.riapt.org)
Author: Rob Parkhill
Short Link: http://www.houseoffusion.com/groups/flex/thread.cfm/threadid:1800#5613
yes there is a way, you add the dir to your CF mapping and then in your flex
install edit the config to look for CFCs inside the CF mapped directories.
Your situation will work fine, with external and internal CFCs just that
the external CFC directory has to be known to CF so that it can share it
with Flex when needed.
to do so, go to your ColdFusion 8 (i presume 8) install directory, go to the
wwwroot dir, open the web-inf dir, open the flex dir, open the
remoting-config.xml in there you will find the following:
<access>
<!-- Use the ColdFusion mappings to find CFCs, by default
only CFC files under your webroot can be found. -->
<use-mappings>true</use-mappings> **** Change this to
TRUE
<!-- allow "public and remote" or just "remote" methods to
be invoked -->
<method-access-level>remote</method-access-level>
</access>
then you can use the local references from your mapped dir to get to your
CFCs, and this would be a one-time thing. I personally don't have a
multi-server model, so I can't say if there is anything else required for
that.
Rob
Rob
On Thu, Dec 18, 2008 at 10:56 PM, Jamie Jackson <jacksonj@calib.com> wrote:
----- Excess quoted text cut - see Original Post for more -----
Author: Jamie Jackson
Short Link: http://www.houseoffusion.com/groups/flex/thread.cfm/threadid:1800#5612
----- Excess quoted text cut - see Original Post for more -----
Bah, I messed up those paths, so just to correct them to avoid confusion:
Say my virtual host doc root is:
/var/www/apps/myapp/wwwroot/
My internal CFCs are here:
/var/www/apps/myapp/model/
And my remote CFCs (that serve as remote proxies for my internal CFCs) are here:
/var/www/apps/myapp/wwwroot/cfc/
My Flex app is here:
/var/www/apps/myapp/wwwroot/flex/
> Is that not possible? If not, why? This stuff is still pretty new and
> foreign to me.
>
> Thanks again,
> Jamie
Author: Jamie Jackson
Short Link: http://www.houseoffusion.com/groups/flex/thread.cfm/threadid:1800#5611
>so then you will have to do what Paul suggested and edit the file to go to
>the correct web root :)
So is there no way to put the CFCs in any other place, and have them still work?
It seems bizarre to require that flash remoting apps need some files to go over
here (in the virtual host root), and some to go over there (in the "CF" web
root). But is that the way it has to work?
Consider this. Here's the way I wanted it to work.
Say my virtual host doc root is:
/var/www/apps/myapp/wwwroot/
My internal CFCs are here:
/var/www/apps/model/
And my remote apps (that serve as remote proxies for my internal CFCs) are here:
/var/www/apps/model/cfc/
My Flex app is here:
/var/www/apps/myapp/wwwroot/flex/
Is that not possible? If not, why? This stuff is still pretty new and foreign to
me.
Thanks again,
Jamie
Author: Rob Parkhill
Short Link: http://www.houseoffusion.com/groups/flex/thread.cfm/threadid:1800#5610
so then you will have to do what Paul suggested and edit the file to go to
the correct web root :)
On Thu, Dec 18, 2008 at 10:26 PM, Jamie Jackson <jacksonj@calib.com> wrote:
----- Excess quoted text cut - see Original Post for more -----
Author: Jamie Jackson
Short Link: http://www.houseoffusion.com/groups/flex/thread.cfm/threadid:1800#5609
>but the CF8 web root? so coldfusion8/wwwroot/cfc/AddressService.cfc
>Rob
Ahh, okay. I've got multi-server, so my paths don't match up quite like that, but
no, it's in my virtual host web root, not under the CF8 wwwroot (which is
/opt/jrun4/servers/childwelfare_old/cfusion.ear/cfusion.war, I think).
Author: Jamie Jackson
Short Link: http://www.houseoffusion.com/groups/flex/thread.cfm/threadid:1800#5608
>what happens when you don't run it through the flex debugger?
I'll try the non-debugger Flash player and see if it makes a difference, to rule
out debugging related stuff.
>Have you
>tried setting up a new project and just calling the CFC from it? Perhaps
>there is a setting off in the current flex project?
Yeah, there could be, and it could easily be something like that, but I'm too new
to FB to be able to easily spot something that's amiss.
>Where are the CFCs
>stored?
Under the web root, in a dir called cfc, but let me know if you need more detail
than that.
>Rob
>
>On Thu, Dec 18, 2008 at 9:54 PM, Jamie Jackson <jacksonj@calib.com>
wrote:
Author: Rob Parkhill
Short Link: http://www.houseoffusion.com/groups/flex/thread.cfm/threadid:1800#5607
but the CF8 web root? so coldfusion8/wwwroot/cfc/AddressService.cfc
Rob
On Thu, Dec 18, 2008 at 10:19 PM, Jamie Jackson <jacksonj@calib.com> wrote:
----- Excess quoted text cut - see Original Post for more -----
Author: Jamie Jackson
Short Link: http://www.houseoffusion.com/groups/flex/thread.cfm/threadid:1800#5606
Thanks for the suggestion. I did just learn about use-mappings this afternoon.
The CFC I'm calling is indeed under the web root, though.
----- Excess quoted text cut - see Original Post for more -----
Author: Paul Hastings
Short Link: http://www.houseoffusion.com/groups/flex/thread.cfm/threadid:1800#5604
Jamie Jackson wrote:
> cfc.AddressService yields:
i missed the beginning of this but...is the cfc dir a web accessible dir under
the webroot or is it a cf mapped dir? if a mapped dir, did you turn on mapped
dirs in remoting-config.xml (web-inf/flex dir):
<!-- Use the ColdFusion mappings to find CFCs, by default only CFC files under
your webroot can be found. -->
<use-mappings>true</use-mappings>
Author: Rob Parkhill
Short Link: http://www.houseoffusion.com/groups/flex/thread.cfm/threadid:1800#5605
what happens when you don't run it through the flex debugger? Have you
tried setting up a new project and just calling the CFC from it? Perhaps
there is a setting off in the current flex project? Where are the CFCs
stored?
Rob
On Thu, Dec 18, 2008 at 9:54 PM, Jamie Jackson <jacksonj@calib.com> wrote:
----- Excess quoted text cut - see Original Post for more -----
Author: Jamie Jackson
Short Link: http://www.houseoffusion.com/groups/flex/thread.cfm/threadid:1800#5603
I added the timeout because I got bored of the waits. The operation should take
very little time.
When I ran the flex debugger without a timeout, I noticed that it went into some
kind of re-queueing routine (into native Flex AS classes) seemingly ad infinitum.
I just now set a timeout of 60 seconds, and same timeout. Now I'll do it again
without a timeout, but AFAIK, it's not going to end up telling me anything,
unfortunately. I'll report back if it does, though.
Jamie
>Have you tried removing your request timeout? It is set to 10. I would
>unset it if you are having timeout problems, perhaps that will reveal
>another issue, or solve the problem.
>Rob
Author: Rob Parkhill
Short Link: http://www.houseoffusion.com/groups/flex/thread.cfm/threadid:1800#5602
Have you tried removing your request timeout? It is set to 10. I would
unset it if you are having timeout problems, perhaps that will reveal
another issue, or solve the problem.
Rob
Author: Jamie Jackson
Short Link: http://www.houseoffusion.com/groups/flex/thread.cfm/threadid:1800#5601
Thanks for the suggestion, but I don't think it's the ticket.
I get the same behavior with "/" and with "." ...see the following.
Thanks for the idea though, please keep them coming. :)
cfc.AddressService yields:
Request timed out
cfc/AddressService yields:
Request timed out
cfc.blah.AddressService yields:
Unable to invoke CFC - Could not find the ColdFusion Component or Interface
cfc.blah.AddressService.
cfc/blah/AddressService yields:
Unable to invoke CFC - Could not find the ColdFusion Component or Interface
cfc/blah/AddressService.
----- Excess quoted text cut - see Original Post for more -----
Author: Rob Parkhill
Short Link: http://www.houseoffusion.com/groups/flex/thread.cfm/threadid:1800#5600
your source is wrong. Flex uses a . syntax same as Coldfusion when calling
cfcs.
your source should read cfc.AddressService
HTH
Rob
On Thu, Dec 18, 2008 at 8:48 PM, Jamie Jackson <jacksonj@calib.com> wrote:
----- Excess quoted text cut - see Original Post for more -----
Author: Jamie Jackson
Short Link: http://www.houseoffusion.com/groups/flex/thread.cfm/threadid:1800#5599
I'm trying to get going with some Flash Remoting from Flex, but I'm having a
tough time of it. My requests from Flex seem to time out, but if I call the same
CFC/method, called via http://mysite/cfc/myCfc.cfc?method=myMethod syntax, it
works right away.
Any ideas as to how to fix or troubleshoot this? Please let me know what more
info you might need from me in order to help.
Thanks,
Jamie
Here's my CFC's method: (/cfc/AddressService.cfc?method=getStates)
====================================================
<cffunction name="getStates" access="remote" output="false"
returntype="query">
<cfset var local = structNew() />
<cfscript>
local.states = querySim('
stateID,countryID,state,state_abbr
1|1|Alabama|AL
2|1|Alaska|AK
...snip...
58|1|Wyoming|WY
');
return local.states;
</cfscript>
</cffunction>
<cffunction name="getCountries" access="public" output="false"
returntype="any">
<cfreturn countries />
</cffunction>
Here's the service setup in MXML
==========================================
<mx:RemoteObject id="addressService"
source="cfc/AddressService"
destination="ColdFusion"
fault="faultHandler(event)"
requestTimeout="10">
<mx:method name="getStates" result="resultHandler(event)"/>
</mx:RemoteObject>
In Flex, I'm having my app dump its error:
==========================================
Request timed out
And here's what I get from the CF console:
===========================================
[Flex] null
java.lang.IllegalStateException
at jrun.servlet.JRunResponse.getOutputStream(JRunResponse.java:183)
at flex.messaging.endpoints.AMFEndpoint.service(AMFEndpoint.java:140)
at flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:438)
at
coldfusion.flex.ColdFusionMessageBrokerServlet.service(ColdFusionMessageBrokerServlet.java:50)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
at
coldfusion.filter.FlashRequestControlFilter.doFilter(FlashRequestControlFilter.java:71)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
at jrun.servlet.FilterChain.service(FilterChain.java:101)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
|
May 25, 2012
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||