ColdBox Proxy Problems

I have a Flex app that’s calling this ColdBox Proxy but I am getting an error no matter what I do. The error is :-

faultString String Reference flex.messaging.MessageException: ColdBox Controller Not Found. The coldbox main controller has not been initialized

The proxy location is in a folder /cfcs/publish.cfc and the code looks like this :-

component output=“false” extends=“coldbox.system.remote.ColdboxProxy” name=“publish”
{
remote any function publishPresentation(video)
{
var lc = {};
arguments[“event”] = “ajax.publishPresentation”;
lc = super.process(argumentCollection=arguments);
return lc;
}
}

In my Application.cfc, I have this

It’s blank because the app is on the webroot.

But I always get this error as stated above.

Any ideas what I could be doing wrong?

Thanks in advance,
Anuj Gakhar

This might be relevant: https://groups.google.com/forum/#!topic/coldbox/gMIRpXlY1Zc

How are you calling the proxy through Flex?

Also, inside your function try this:

component output=“false” extends=“coldbox.system.remote.ColdboxProxy” name=“publish”
{
remote any function publishPresentation(video)
{

var controller = getController();
var event = controller.getRequestService().getContext();

var lc = {};
arguments[“event”] = “ajax.publishPresentation”;
lc = super.process(argumentCollection=arguments);
return lc;
}
}

Does that allow it to work?

I don’t believe you can initialize a ColdBox application through the proxy. You must first hit a “normal” event to init the framework.

Could that be your issue?

Aaron Greenlee
http://aarongreenlee.com/

That’s not the case. You just have to have your app mapping defined in application.cfc. Otherwise the loader service will start looking for your config file under the proxy folder.

~Brad

Thanks for the correction, Brad.

I did try putting the app mapping as well, but same error. How can I test that its all setup correctly ?

Just to re-iterate , my app sits in /var/www/codebase

and in Apache I have the virtual host setup to point testing.example.com point to /var/www/codebase

and in the Railo administrator I have added a mapping called “testing” that points to /var/www/codebase

and in my Application.cfc I have added APP_MAPPING = “testing” (also tried leaving it blank)

and I still get the same error when accessed from a Flex app…

APP_Mapping should be defined as “/” if I am wrong others will hopefully correct me, as I prefer to use the RESTful API when doing Flex work through normal controllers.

I have tried blank string, “/” and “testing” as my COLDBOX_APP_MAPPING - nothing works :frowning:

OK - it works if the proxy is on the root of the folder or in a folder called “remote” but proxt.cfc in any other folder won’t work. Is that a convention ? or am I doing something wrong?

And when I say it works - I can get the Flex app to at-least connect to it and start talking to it (ie not throw any errors). I can get it to return simple strings etc but I still can’t get the super.process() to work - so that’s my next challenge.