Lucee 4.5.3.013 Error: Can't cast Complex Object Type Struct to String

913 views
Skip to first unread message

Michael Vornkahl

unread,
Apr 26, 2016, 3:33:02 AM4/26/16
to Lucee
Hi everybody,
I have a very simple code, which creates an array with one value and then add a column to an existing query and fills it with this value:
        <cfset TestUserArray[1] = -1>
        <cfset temp=QueryAddcolumn(CheckUser,"Map_No",TestUserArray)>
This worked since the last versions, but after the last update, I get the following error-message:

Lucee 4.5.3.013 Error (expression)
Message Can't cast Complex Object Type Struct to String
Detail Use Built-In-Function "serialize(Struct):String" to create a String from Struct
Stacktrace The Error Occurred in
D:\Inetpub\wwwroot\AbbVie-Portal\GER1304\visite1a.cfm: line 289
287: </cfquery>
288: <cfset TestUserArray[1] = -1>
289: <cfset temp=QueryAddcolumn(CheckUser,"Map_No",TestUserArray)>
290: <cfset TestUserArray[1] = "">
291: <cfset temp=QueryAddcolumn(CheckUser,"Title",TestUserArray)>

Java Stacktrace Can't cast Complex Object Type Struct to String
  at lucee.runtime.type.util.StructSupport.castToString(StructSupport.java:181):181
  at lucee.runtime.op.Caster.toString(Caster.java:1863):1863
  at lucee.runtime.functions.query.QueryAddColumn.call(QueryAddColumn.java:45):45
  at abbvie_portal315.ger1304.visite1a_cfm$cf.call(D:\Inetpub\wwwroot\AbbVie-Portal\GER1304\visite1a.cfm:289):289
  at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:925):925
  at lucee.runtime.listener.ClassicAppListener._onRequest(ClassicAppListener.java:58):58
  at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:38):38
  at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2265):2265
  at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2228):2228
  at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:456):456
  at lucee.loader.servlet.CFMLServlet.service(Unknown Source):-1
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:728):728
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305):305
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210):210
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222):222
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123):123
  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502):502
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171):171
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99):99
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118):118
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408):408
  at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:200):200
  at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589):589
  at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310):310
  at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source):-1
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source):-1
  at java.lang.Thread.run(Unknown Source):-1

Does anyone have a tipp for me?
Thank you
Michael


Gert Franz

unread,
Apr 26, 2016, 3:43:38 AM4/26/16
to lu...@googlegroups.com
Hello Michael,

Normally this shouldn't have worked in any version. The line 

TestUserArray[1] = -1;

Creates the variable TestUserArray as a struct and not as an array, unless you would have something like

TestUserArray = []; 

In your code.

Sent from somewhere on the road
--
Love Lucee? Become a supporter and be part of the Lucee project today! - http://lucee.org/supporters/become-a-supporter.html
---
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/9c62d315-a27e-4de9-8ee2-078bf0b27d69%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Zac Spitzer

unread,
Apr 26, 2016, 3:58:46 AM4/26/16
to lu...@googlegroups.com
I filed a bug about this a while back



For more options, visit https://groups.google.com/d/optout.



--
Zac Spitzer
+61 405 847 168

Michael Vornkahl

unread,
Apr 26, 2016, 7:39:36 AM4/26/16
to Lucee
@Gert: Sorry,
I forgot to paste the line before the two statements:

        <cfset TestUserArray = ArrayNew(1)>

        <cfset TestUserArray[1] = -1>
        <cfset temp=QueryAddcolumn(CheckUser,"Map_No",TestUserArray)>
I think, that this should work. (It did work up to version 4.5.3.011)
Now under 4.5.3.013 it didn't work anymore.

Greetings MV

Michael Vornkahl

unread,
Apr 26, 2016, 7:52:55 AM4/26/16
to Lucee
Sorry again!!!!
I found it, somebody (I assume it was my left hand :-) ) deleted the line '<cfset TestUserArray = ArrayNew(1)>' in this file where the error occurs.
I added it and now everything works fine.

Sorry again for the trouble

Michael
Reply all
Reply to author
Forward
0 new messages