Nick
02/19/2025, 2:45 PMjava.lang.ClassCastException
⢠or class coldfusion.runtime.AttributeCollection cannot be cast to class java.lang.String (coldfusion.runtime.AttributeCollection is in unnamed module of loader coldfusion.bootstrap.BootstrapClassLoader @56a4f272; java.lang.String is in module java.base of loader 'bootstrap')
The ClassCastException
has absolutely no other info in the stacktrace. No file or line number.
The AttributeCollection
error is breaking in an init()
in a CFC. The CFC has a property name="foo" type="cfc.models.bar";
and the failing line in the init()
is variables.foo = new cfc.models.bar();
. Bar.cfc's init()
takes no arguments, so the AttributeCollection
doesn't really make any sense.
This all appears to be a race condition. If I get this error once, it never goes away until I restart the CF service or make a trivial change inside Bar.cfc like changing a method with return something.booleanFormat()
to return booleanFormat(something)
. (This is just one example... other trivial changes generally work too.) Once it's working, it never fails again until the next morning... again, likely after the application times out and CF automatically reinitializes it.
Anyone know where to even start with something like this? I'm in ACF 2023, and I recently updated to jdk 17.0.14 with no change.aliaspooryorik
Nick
02/19/2025, 3:16 PMaliaspooryorik
?resetmapp=true
flag or similar) which is breaking the locking?Nick
02/19/2025, 3:17 PMaliaspooryorik
Nick
02/19/2025, 3:18 PMBill Nourse
02/19/2025, 3:45 PMNick
02/19/2025, 3:47 PMNick
02/19/2025, 3:51 PMaliaspooryorik
Nick
02/19/2025, 3:52 PMaliaspooryorik
aliaspooryorik
Nick
02/19/2025, 3:53 PMaliaspooryorik
carehart
02/19/2025, 5:08 PMNick
02/20/2025, 5:09 PMcarehart
02/20/2025, 5:12 PMBK BK
02/27/2025, 1:26 PM@Nick: Our application timeout is about 4 hours.... Almost every morning (likely after the application times out and resets on its own,...
I think that that is the cause of the issue right there. Apparently, no one uses the application for long periods during the night. If no user interacts with the application within 4 hours, then the application will time out. It will no longer be active after that.
Application timeout means that, after 4 hours, there is, in effect, no application to talk about. To borrow from Monty Python's Dead-Parrot sketch, the application "is no more", "has ceased to be", "bereft of life, it rests in peace" and "is an ex-application".
Hence it won't have the resources to reset on its own . That would explain why you see little to nothing in the logs and why a restart of the application is necessary.
If you want the application to live longer, then you will have to increase the applicationTimeout value.BK BK
02/28/2025, 8:56 PM<cffunction name="onApplicationEnd">
<cfargument name="ApplicationScope" required=true >
<cfscript>
var adminObj = createObject("Component", "cfide.adminapi.administrator");
adminObj.login("your_cf_admin_password");
var cfAdminRuntimeService = createObject("component", "cfide.adminapi.runtime");
// Clear caches
cfAdminRuntimeService.clearQueryCache();
cfAdminRuntimeService.clearTrustedCache();
cfAdminRuntimeService.clearComponentCache();
</cfscript>
<cflog file="#this.name#" type="Information" text="Application #this.name# has just ended">
</cffunction>
carehart
03/06/2025, 3:34 PMNick
03/10/2025, 2:13 PMcarehart
03/10/2025, 2:28 PM