The following code works on Adobe ColdFusion 9.01+ but not Railo 4.1
Furthermore, this only fails on Post
This code is called inside of FW/1 setupRequest()
in application.cfc
<cfthread name="threadA" action="run">
<cftry>
<cfquery>
INSERT
INTO dbo.Traffic (Circuit, Fuseaction, IP_hash)
VALUES (<cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#listfirst(variables.rc.fuseaction, '.')#">,
<cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#listlast(variables.rc.fuseaction, '.')#">,
<cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#cgi.remote_addr#">
)
</cfquery>
<cfcatch />
</cftry>
</cfthread>
Error
java.lang.NullPointerException at railo.runtime.net.http.HttpUtil.cloneParameters(HttpUtil.java:66):66 at railo.runtime.net.http.HttpServletRequestDummy.clone(HttpServletRequestDummy.java:677):677 at railo.runtime.thread.ThreadUtil.cloneHttpServletRequest(ThreadUtil.java:67):67 at railo.runtime.thread.ThreadUtil.clonePageContext(ThreadUtil.java:29):29 at railo.runtime.thread.ChildThreadImpl.(ChildThreadImpl.java:101):101 at railo.runtime.tag.ThreadTag.register(ThreadTag.java:269):269 at scorecard38.application_cfc$cf.udfCall(D:\railo\webapps\www\Scorecard38\Application.cfc:162):162 at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:94):94
Wild Guess
variables.rc
is not getting copied into the thread
variables.rc
will not be copied into the thread unless you add it as an argument. Addrc
as an argument and then instead ofvariables.rc
you'll access it viaarguments.rc
If that doesn't work you'll have to remove the
try
/catch
and dump out your cfthread to see the error. The code below will output 'Variable C is undefined'