ColdFusion 2021 - class coldfusion.runtime.TemplateProxy cannot be cast to class

New Here ,
Apr 06, 2021 Apr 06, 2021

Copy link to clipboard

Copied

I installed ColdFusion 2021 and now I catch some error:
class coldfusion.runtime.TemplateProxy cannot be cast to class coldfusion.runtime.Struct (coldfusion.runtime.TemplateProxy and coldfusion.runtime.Struct are in unnamed module of loader coldfusion.bootstrap.BootstrapClassLoader @3b2553d9)
I investigated the issue and found that we can't use Structure this.EnvStruct.Items directly in the query. 
ErrorCase.png
I fixed the query:
SuccessCase.png
But It's not a good idea, because we have a lot of functions when we use the structure, this code is working in Coldfusion11 and Coldfusion2018.  Could you help me?

Views

80

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Apr 06, 2021 Apr 06, 2021

Copy link to clipboard

Copied

Sergey, as a sanity check, can you simply do a cfdump before the cfquery of the 3 things: this.EnvStruct.Items, this.EnvStruct, and this (in that order), to confirm that what is in them is indeed what you expect?  Of course, what matters most is the first, but doing the others after it may be insightful. 

 

Note that depending on other code we can't see, you may need to do more to be able to SEE that cfdump. Let's wait to hear back before proposing solutions to that. (At a minimum, it may help to do a cfabort right before the cfquery, to prevent its error from happening.)


/Charlie (server troubleshooter, carehart.org)

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 07, 2021 Apr 07, 2021

Copy link to clipboard

Copied

Charlie, I saved a dump for 3 objects in files and they have valid structure. I see the error: class coldfusion.runtime.TemplateProxy cannot be cast to class coldfusion.runtime.Struct (coldfusion.runtime.TemplateProxy and coldfusion.runtime.Struct are in unnamed module of loader coldfusion.bootstrap.BootstrapClassLoader @609e57da).

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Apr 08, 2021 Apr 08, 2021

Copy link to clipboard

Copied

LATEST

@Sergey5C5F , please report a query-of-query bug.

 

In the meantime, try something like

SELECT *
FROM #this.EnvStruct.Items#

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines