I am using ColdboxProxy.cfc so that my company’s external application can make AJAX calls to our internal coldbox app.
So far so good, in terms of, I am able to call everything in my model layer. So the external app can consume the webservice method, which calls all my model methods to save/add data to the database.
The problem arises when I want the remote function in Coldbox Proxy, to fire an event in my coldbox eventhandler.
I have scoured the google groups for any similar issues, but it seems like I am the only one with this problem. So I would like some help from the community as to what I am doing wrong.
I have also scoured the Coldbox wiki, and have followed the example[s] to the best of my knowledge.
I will try and describe what my remote function does.
I make a webservice call to coldboxproxy.cfc?method=registerUser&personID=1101&eventFlag=2&frmRegister=registrationsubmitted
So I have a remote function, obviously, called “registerUser”, I make a call out to the baseService from my model, and pass these 3 arguments to a “save()” method. My save method returns a boolean if it was successful.
So far I get result=true, check my DB, and voila, my user has been added.
It’s the last part of this method that fails. I have added CFComments below to show the part that fails.
- yes my proxy extends, the coldbox.system.remote.ColdboxProxy.
- The error that gets thrown is below:
Detail The cbevent variable does not exist in the arguments. ErrorCode [empty string] ExtendedInfo [empty string] Message Event not detected
Type ColdBoxProxy.NoEventDetected
I will add the stack trace below the code snippet, in case it makes sense to anyone.
Also a quick note about my code below. basically the arguments I pass in to my remote function, I need to pass them in to the event I am trying to fire off. What’s the best way to do that? If you see the commented out line before I call super.process, that was my attempt at passing the rc variables in.
- Should I be setting arguments[‘event’] to some cbController method that gets an event object?
- My coldboxproxy.cfc, is right at the top level of my webroot, on the same level as application.cfc. I read some of the posts suggesting to set an App_Mapping, but I have no need for that since my app is the webroot. Any suggestions?
All help is greatly appreciates.
Cheers, Ali
Code Snippet taken from ColdboxProxy.cfc MethodName=RegisterLoggedIn
<cfset results = eventService.save(entityDetails = attendeeMemento,
entityTypeID = local.entityType,
matchEntityColumns = local.matchEntityColumns
) />
Stack Dump from error:
StackTrace coldfusion.runtime.CustomException: Event not detected at coldfusion.tagext.lang.ThrowTag.doStartTag(ThrowTag.java:142) at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2799) at cfUtil2ecfc561846773$funcTHROWIT.runFunction(D:\WEB\coldBox\system\core\util\Util.cfc:164) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:655) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:444) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:414) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2432) at cfColdboxProxy2ecfc415248139$funcPROCESS.runFunction(D:\WEB\coldBox\system\remote\ColdboxProxy.cfc:48) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:518) at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2624) at coldfusion.runtime.SuperScope.invoke(SuperScope.java:18) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2373) at cfRWS2ecfc1809153839$funcREGISTERLOGGEDIN22.runFunction(D:\WEB\RW2014Roadmap3\Relayware\RWS.cfc:45) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:518) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:660) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:469) at coldfusion.filter.ComponentFilter.invoke(ComponentFilter.java:193) at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:442) at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48) at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:79) at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40) at coldfusion.filter.PathFilter.invoke(PathFilter.java:112) at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:30) at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94) at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28) at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38) at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:58) at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at coldfusion.xml.rpc.CFCServlet.invoke(CFCServlet.java:155) at coldfusion.xml.rpc.CFCServlet.doGet(CFCServlet.java:289) at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42) at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:414) at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:204) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722)