Cffunction Error; regression 4.5.4 to 5.2.1


#1

I have an application.cfm that calls an accela.cfc file. The code is below for each.
This code worked on 4.5.4.017 before I upgraded to 5.2.1.9. I copied this code to another 4.5.4.017 lucee server and it works fine there.

I received the following error:

Lucee 5.2.1.9 Error (template) 
Message Syntax Error, Invalid Construct 
Stacktrace The Error Occurred in
C:\inetpub\wwwroot\slam\accela.cfc: line 1  

1: <cffunction access="remote" name="recordstoken" output="no" returntype="string">
 2: <cfhttp method="post" timeout="3600" url="https://apis.accela.com/oauth2/token" >
 3: <cfhttpparam type="header" name="Content-Type" value="application/x-www-form-urlencoded">

called from C:\inetpub\wwwroot\slam\application.cfm: line 5  
Java Stacktrace lucee.runtime.exp.TemplateException: Syntax Error, Invalid Construct 
 	at lucee.transformer.cfml.expression.AbstrCFMLExprTransformer.checker(AbstrCFMLExprTransformer.java:1012) 
 	at lucee.transformer.cfml.expression.AbstrCFMLExprTransformer.clip(AbstrCFMLExprTransformer.java:952) 
 	at lucee.transformer.cfml.expression.AbstrCFMLExprTransformer.negatePlusMinusOp(AbstrCFMLExprTransformer.java:940) 
 	at lucee.transformer.cfml.expression.AbstrCFMLExprTransformer.unaryOp(AbstrCFMLExprTransformer.java:876) 
 	at lucee.transformer.cfml.expression.AbstrCFMLExprTransformer.expoOp(AbstrCFMLExprTransformer.java:865) 
 	at lucee.transformer.cfml.expression.AbstrCFMLExprTransformer.divMultiOp(AbstrCFMLExprTransformer.java:805) 
 	at lucee.transformer.cfml.expression.AbstrCFMLExprTransformer.modOp(AbstrCFMLExprTransformer.java:773) 
 	at lucee.transformer.cfml.expression.AbstrCFMLExprTransformer.plusMinusOp(AbstrCFMLExprTransformer.java:725) 
 	at lucee.transformer.cfml.expression.AbstrCFMLExprTransformer.concatOp(AbstrCFMLExprTransformer.java:690) 
 	at lucee.transformer.cfml.expression.AbstrCFMLExprTransformer.decsionOp(AbstrCFMLExprTransformer.java:523) 
 	at lucee.transformer.cfml.expression.AbstrCFMLExprTransformer.notOp(AbstrCFMLExprTransformer.java:508) 
 	at lucee.transformer.cfml.expression.AbstrCFMLExprTransformer.andOp(AbstrCFMLExprTransformer.java:478) 
 	at lucee.transformer.cfml.expression.AbstrCFMLExprTransformer.orOp(AbstrCFMLExprTransformer.java:459) 
 	at lucee.transformer.cfml.expression.AbstrCFMLExprTransformer.xorOp(AbstrCFMLExprTransformer.java:441) 
 	at lucee.transformer.cfml.expression.AbstrCFMLExprTransformer.eqvOp(AbstrCFMLExprTransformer.java:424) 
 	at lucee.transformer.cfml.expression.AbstrCFMLExprTransformer.impOp(AbstrCFMLExprTransformer.java:407) 
 	at lucee.transformer.cfml.expression.AbstrCFMLExprTransformer.conditionalOp(AbstrCFMLExprTransformer.java:361) 
 	at lucee.transformer.cfml.expression.AbstrCFMLExprTransformer.assignOp(AbstrCFMLExprTransformer.java:337) 
 	at lucee.transformer.cfml.expression.AbstrCFMLExprTransformer.expression(AbstrCFMLExprTransformer.java:287) 
 	at lucee.transformer.cfml.script.CFMLScriptTransformer.expression(CFMLScriptTransformer.java:60) 
 	at lucee.transformer.cfml.script.AbstrCFMLScriptTransformer.expressionStatement(AbstrCFMLScriptTransformer.java:1984) 
 	at lucee.transformer.cfml.script.AbstrCFMLScriptTransformer.statement(AbstrCFMLScriptTransformer.java:242) 
 	at lucee.transformer.cfml.script.AbstrCFMLScriptTransformer.statement(AbstrCFMLScriptTransformer.java:216) 
 	at lucee.transformer.cfml.script.AbstrCFMLScriptTransformer.statements(AbstrCFMLScriptTransformer.java:199) 
 	at lucee.transformer.cfml.script.AbstrCFMLScriptTransformer.statements(AbstrCFMLScriptTransformer.java:183) 
 	at lucee.transformer.cfml.script.CFMLScriptTransformer.transform(CFMLScriptTransformer.java:54) 
 	at lucee.transformer.cfml.tag.CFMLTransformer.tag(CFMLTransformer.java:633) 
 	at lucee.transformer.cfml.tag.CFMLTransformer.body(CFMLTransformer.java:363) 
 	at lucee.transformer.cfml.tag.CFMLTransformer.transform(CFMLTransformer.java:303) 
 	at lucee.transformer.cfml.tag.CFMLTransformer.transform(CFMLTransformer.java:221) 
 	at lucee.runtime.compiler.CFMLCompilerImpl._compile(CFMLCompilerImpl.java:126) 
 	at lucee.runtime.compiler.CFMLCompilerImpl.compile(CFMLCompilerImpl.java:74) 
 	at lucee.runtime.PageSourceImpl._compile(PageSourceImpl.java:355) 
 	at lucee.runtime.PageSourceImpl.compile(PageSourceImpl.java:322) 
 	at lucee.runtime.PageSourceImpl.loadPhysical(PageSourceImpl.java:277) 
 	at lucee.runtime.PageSourceImpl.loadPageThrowTemplateException(PageSourceImpl.java:182) 
 	at lucee.runtime.PageSourceImpl.loadPage(PageSourceImpl.java:894) 
 	at lucee.runtime.component.ComponentLoader._search(ComponentLoader.java:210) 
 	at lucee.runtime.component.ComponentLoader._search(ComponentLoader.java:100) 
 	at lucee.runtime.component.ComponentLoader.searchComponent(ComponentLoader.java:74) 
 	at lucee.runtime.PageContextImpl.loadComponent(PageContextImpl.java:3140) 
 	at lucee.runtime.tag.Invoke.doComponent(Invoke.java:218) 
 	at lucee.runtime.tag.Invoke.doEndTag(Invoke.java:194) 
 	at slam.application_cfm$cf.call(/slam/Application.cfm:5) 
 	at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:928) 
 	at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:842) 
 	at lucee.runtime.listener.ClassicAppListener._onRequest(ClassicAppListener.java:54) 
 	at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:44) 
 	at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2408) 
 	at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2398) 
 	at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2366) 
 	at lucee.runtime.engine.Request.run(Request.java:34) 

Accela.cfc

<cffunction access="remote" name="recordstoken" output="no" returntype="string">
<cfhttp  method="post"   timeout="3600"  url="https://apis.accela.com/oauth2/token" >
<cfhttpparam type="header" name="Content-Type" value="application/x-www-form-urlencoded">
<cfhttpparam type="formfield"  name="grant_type" value="password">
<cfhttpparam type="formfield"  name="client_id" value="12345">
<cfhttpparam type="formfield"  name="client_secret" value="abcd">
<cfhttpparam type="formfield"  name="username" value="d@d.org">
<cfhttpparam type="formfield"  name="password" value="123456">
<cfhttpparam type="formfield"  name="agency_name" value="sanleandro">
<cfhttpparam type="formfield"  name="environment" value="PROD">
<cfhttpparam type="formfield"  name="id_provider" value="citizen">
<cfhttpparam type="formfield"  name="scope" value="records inspections addresses parcels contacts reports workflows settings owners"> 
</cfhttp>

<cfset token = #deserializeJSON(cfhttp.fileContent)# />
<cfreturn #token.access_token#>
</cffunction>

application.cfm

<CFAPPLICATION NAME="Accela"
SESSIONMANAGEMENT="Yes"
SESSIONTIMEOUT="#CreateTimeSpan(0, 0, 60, 0)#">
<cfif not isdefined("session.authtoken")>
<cfinvoke component="accela" method="recordstoken" returnvariable="recordtoken">
<cfset session.authtoken = "#recordtoken#">
</cfif>

#2

Is that the whole file? ie. there doesn’t appear to be a <cfcomponent> tag in there