I have just started working with Flash Remoting and am having trouble with what
appears to be a bug in the service.
These two threads have not found a solution for me and I haven't seen anything
from Macromedia support which will cover the problem.
[L=Thread
1]http://www.macromedia.com/cfusion/webforums/forum/messageview.cfm?catid=250&th
readid=678322&highlight_key=y&keyword1=NullPointerException[/L]
[L=Thread
2]http://www.macromedia.com/cfusion/webforums/forum/messageview.cfm?catid=250&th
readid=722102&highlight_key=y&keyword1=SERVER%2EPROCESSING[/L]
When I try use Flash Remoting I receive this error:
java.lang.NullPointerException
Service threw an exception during method invocation: null
My Flash connection code is as follows, which was taken almost straight from
the Flash MX Pro 2004 for Server Geeks book:
#include "NetServices.as"
#include "NetDebug.as"
var gatewayURL = "http://localhost/flashservices/gateway";
var serviceName = "casinograde.chipbuilder";
// Here are the standard lines that get us connected to the server
NetServices.setDefaultGatewayUrl(gatewayURL);
var frConnection = NetServices.createGatewayConnection();
var rs = frConnection.getService(serviceName, this);
rs.getproduct();
function getproduct_Status(error) {
trace(error.description);
}
Here is the Cold Fusion cfc page code and this was paired down quite a bit to
try to find the culprit to the problem:
<cfcomponent>
<cffunction name="getproduct" access="remote">
<cfset var world="hello">
<cfreturn world>
</cffunction>
</cfcomponent>
Below is the complete debug trace I receive:
DebugId: 0
EventType: "AmfStatusCall"
MethodName: "/1/onStatus"
MovieUrl: "file:///C|/websites/casinograde/chipbuilder/chipbuilder.swf"
Protocol: "http"
ResponseURI: (undefined)
Source: "Server"
Time: 1082225122234
Date (object #1)
....."Sat Apr 17 13:05:22 GMT-0500 2004"
Parameters (object #2)
.....code: "SERVER.PROCESSING"
.....description: "Service threw an exception during method invocation: null"
.....details: "java.lang.NullPointerException
at
coldfusion.runtime.TemplateClassLoader.findApplicationCfm(TemplateClassLoader.ja
va:82)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:89)
at coldfusion.filter.FlashTemplateFilter.invoke(FlashTemplateFilter.java:37)
at coldfusion.filter.FlashFilter.invoke(FlashFilter.java:75)
at
coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilt
er.java:28)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:43)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.flash.FlashProxy.invokeTemplate(FlashProxy.java:103)
at
flashgateway.adapter.coldfusion.ColdFusionAdapter.invokeFunction(ColdFusionAdapt
er.java:107)
at flashgateway.filter.AdapterFilter.invoke(AdapterFilter.java:266)
at flashgateway.filter.SecurityFilter.invoke(SecurityFilter.java:85)
at flashgateway.filter.LicenseFilter.invoke(LicenseFilter.java:58)
at flashgateway.filter.ErrorFilter.invoke(ErrorFilter.java:44)
at flashgateway.filter.LogFilter.invoke(LogFilter.java:43)
at flashgateway.filter.BatchProcessFilter.invoke(BatchProcessFilter.java:63)
at flashgateway.filter.DebugFilter.invoke(DebugFilter.java:38)
at flashgateway.filter.SerializationFilter.invoke(SerializationFilter.java:59)
at flashgateway.Gateway.invoke(Gateway.java:194)
at flashgateway.controller.GatewayServlet.service(GatewayServlet.java:56)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:252)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:527)
at
jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:192)
at
jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:348)
at
jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:451)
at
jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:294)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
"
.....level: "error"
.....type: "java.lang.NullPointerException"
I get the feeling that this is a software problem. Either a conflict with the
server and Windows SP4 or the JRun server and Flash....etc.
Please HELP!!
Thanks in advanced....
Jane
dicknjane - 17 Apr 2004 19:51 GMT
To rule out Cold Fusion cfc problems, I went back a step and used a more simple
example of Flash Remoting from my book. This example calls a Cold Fusion page
which does one query and returns the results. This example worked fine. I
took the example Cold Fusion page and turned it into a cfc page with component
and cffunction returning the same results and I received the
java.lang.NullPointerException .
I will search the Cold Fusion forums for a problem with cfcomponent or
cffunction when they bring the site back up. If anyone has information on the
solution, please respond to this thread.
Thanks!
Simon Sphynx - 23 Apr 2004 14:18 GMT
Try putting a returntype in the function name eg
<cffunction name="getproduct" access="remote" returntype="string">
> To rule out Cold Fusion cfc problems, I went back a step and used a more simple
> example of Flash Remoting from my book. This example calls a Cold Fusion page
[quoted text clipped - 8 lines]
>
> Thanks!