PDA

View Full Version : Service threw an exception during method invocation: null


Dawnthea
08-16-2004, 09:07 PM
Has anyone tried to do the "Hello World" test for Flash Remoting MX 2004 and ColdFusion 6.1? Thank's in advance for any assistance.

What this test has you do is

1) download the remoting components and install them -- here is the link: http://www.macromedia.com/devnet/mx/flashremoting/
2) create a .cfm file with a single line of code: <cfset flash.result = "Hello from ColdFusion MX!">
3) create a flash file with one dynamic text field in it
4) drag the remoting components on to the stage in the flash file
5) add some action script (that you copy from their documentation).

And when you compile the flash file into a .swf you are supposed to see the text "Hello from ColdFusion MX!" in the text field.

My text field says "service threw an exception during invocation: null"

I think I did everything they said to do, and I'm stumped. If anyone else can get this to work, I'd love to hear what you did.

Here is the link to the documentation
http://www.macromedia.com/support/documentation/en/flash_remoting/

Also, here is the NetConnection Debugger information I get when I see the error:
MethodName: "/1/onStatus"
ResponseURI: (undefined)
Parameters (object #2)
.....code: "SERVER.PROCESSING"
.....description: "Service threw an exception during method invocation: null"
.....details: "java.lang.NullPointerException
at coldfusion.runtime.TemplateClassLoader.findApplica tionCfm(TemplateClassLoader.java:82)
at coldfusion.filter.ApplicationFilter.invoke(Applica tionFilter.java:89)
at coldfusion.filter.FlashTemplateFilter.invoke(Flash TemplateFilter.java:37)
at coldfusion.filter.FlashFilter.invoke(FlashFilter.j ava:75)
at coldfusion.filter.LicenseFilter.invoke(LicenseFilt er.java:24)
at coldfusion.filter.ClientScopePersistenceFilter.inv oke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilt er.java:43)
at coldfusion.filter.DatasourceFilter.invoke(Datasour ceFilter.java:22)
at coldfusion.flash.FlashProxy.invokeTemplate(FlashPr oxy.java:103)
at flashgateway.adapter.coldfusion.ColdFusionAdapter. invokeFunction(ColdFusionAdapter.java:107)
at flashgateway.filter.AdapterFilter.invoke(AdapterFi lter.java:266)
at flashgateway.filter.SecurityFilter.invoke(Security Filter.java:85)
at flashgateway.filter.LicenseFilter.invoke(LicenseFi lter.java:58)
at flashgateway.filter.ErrorFilter.invoke(ErrorFilter .java:44)
at flashgateway.filter.LogFilter.invoke(LogFilter.jav a:43)
at flashgateway.filter.BatchProcessFilter.invoke(Batc hProcessFilter.java:63)
at flashgateway.filter.DebugFilter.invoke(DebugFilter .java:38)
at flashgateway.filter.SerializationFilter.invoke(Ser ializationFilter.java:59)
at flashgateway.Gateway.invoke(Gateway.java:194)
at flashgateway.controller.GatewayServlet.service(Gat ewayServlet.java:56)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker. java:91)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvok erChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequ estDispatcher.java:252)
at jrun.servlet.ServletEngineService.dispatch(Servlet EngineService.java:527)
at jrun.servlet.http.WebService.invokeRunnable(WebSer vice.java:168)
at jrunx.scheduler.ThreadPool$DownstreamMetrics.invok eRunnable(ThreadPool.java:348)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRu nnable(ThreadPool.java:451)
at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeR unnable(ThreadPool.java:294)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java :66)
"
.....level: "error"
.....type: "java.lang.NullPointerException" :confused:

willmulder
08-31-2004, 08:43 AM
surely there's a cfreturn or something that passes a result back to flash from the CFm file?

or if using a cffunction then there'd also be a a return 'type'...

Dawnthea
09-01-2004, 01:37 PM
I'm not sure what solved it, but I did two things and those combined seemed to fix it. At any rate I'm now using Flash remoting to transfer and receive data from CF. The first thing I found out -- which is not very well documented at all at Macromedia is that by default, Flash remoting cannot access ColdFusion MX 6.1 thorugh web services. So after you install your CF server and have it going, you have to locate the servlet definition for FlashGateway and change the DISABLE_CFWS_ADAPTERS init-param from true to false. This parameter is in a file called web.xml and on my server it was in the WEB-INF folder under wwwroot.

The second thing was that I assumed because we have Flash MX 2004 professional, I mistakenly thought I only needed to download Flash Remoting for actionscript 2.0. But I finally found a tutorial on updating a database using Flash MX Professional 2004 at
http://www.macromedia.com/devnet/mx/flash/articles/delta_packet.html
that pointed out you also needed to download both Actionscript 2.0 for Flash MX 2004 and Actionscript 1.0 for Flash MX 2004. After I turned on the FlashGateway on the server and installed both components, it finally started working and the message went away.

:-) Dawn