Status/Resolution/Reason: To Fix//BugReVerified
Reporter/Name(from Bugbase): A. B. / ()
Created: 02/11/2019
Components: Event Gateway
Versions: 2018
Failure Type: Incorrectly functioning
Found In Build/Fixed In Build: 2018.0.01.311402 /
Priority/Frequency: Major / Some users will encounter
Locale/System: / Win 2016
Vote Count: 2
Problem Description:
We used an attribute of type integer in calling a ColdFusion event gateway. So far, it has worked without problems in every version of ColdFusion until now.
Unlike previous ColdFusion versions, ColdFusion 2018 apparently distinguishes between integer (java.lang.Integer) and string (java.lang.String) for the gateway attribute. This results in java.lang.ClassCastException
Steps to Reproduce:
1) Create an event gateway called classCastExceptionTestGW in the usual way, including of course a listener CFC.
2) Write a CFM calling page, testGateway.cfm, containing the following code:
<cfscript>
aSyncData = {};
aSyncData.timeout = 60;
sendGatewayMessage("classCastExceptionTestGW", aSyncData);
</cfscript>
3) Launch testGateway.cfm to run the gateway
Actual Result:
You will get 2 types of Error messages:
"Error","ajp-nio-8022-exec-8","02/11/19","10:39:00","StudiemeterStaging2018","'' The specific sequence of files included or processed is: Absolute\path\to\testGateway.cfm'' "
java.lang.ClassCastException
"Error","ajp-nio-8022-exec-6","02/09/19","10:52:00","StudiemeterStaging2018","java.base/java.lang.Integer cannot be cast to java.base/java.lang.String The specific sequence of files included or processed is: E:\wwwroot\staging2018_studiemeter_nl\htdocs\scheduled\StartResultsQueue.cfm, line: 5 "
java.lang.ClassCastException: java.base/java.lang.Integer cannot be cast to java.base/java.lang.String
Expected Result:
No such errors. After all, ColdFusion is weakly-typed and backward-compatible.
Any Workarounds:
Change the timeout attribute value from integer (60) to string ("60")
Attachments:
Comments: