0 Replies Latest reply on Mar 24, 2009 8:02 AM by Stressed_Simon

    Coldspring issue

    Stressed_Simon Level 1
      I have an issue where Coldspring is working fine with my site, then after some time Colsdspring throws an error stating “Array Element Type Mismatch”.

      Having had a look at the code further Coldspring is errors when it reaches line 1106 in defaultXMLBeanFactory.cfc

      The line of code is:

      <cfset var flattenedMetaData = duplicate(arguments.md)/>

      This line of code belongs to the “flattenMetaData” function and it takes the metadata of a CFC as a parameter (arguments.md).

      <cffunction name="flattenMetaData" access="public" output="false" hint="takes metadata, copies inherited methods into the top level function array, and returns it" returntype="struct">
      <cfargument name="md" type="struct" required="true" />
      <cfset var iIndex = "" />
      <cfset var flattenedMetaData = duplicate(arguments.md)/>
      <cfset var foundFunctions = ""/>
      <cfset var access = "" />

      <cfset flattenedMetaData.functions = arraynew(1)/>

      <cfloop condition="true">
      <cfif structKeyExists(arguments.md, "functions")>
      <cfloop from="1" to="#arrayLen(arguments.md.functions)#" index="iIndex">
      <!--- get the access type, so we can skip private methods --->
      <cfif structKeyExists(arguments.md.functions[iIndex],'access')>
      <cfset access = arguments.md.functions[iIndex].access />
      <cfset access = 'public' />
      <cfif not listFind(foundFunctions,arguments.md.functions[iIndex].name)>
      <cfset foundFunctions = listAppend(foundFunctions,arguments.md.functions[iIndex].name)/>
      <cfif access is not 'private'>
      <cfset arrayAppend(flattenedMetaData.functions,duplicate(arguments.md.functions[iIndex]))/>
      <cfif structKeyExists(arguments.md, "extends")>
      <cfset arguments.md = arguments.md.extends />
      <cfbreak />
      <cfreturn flattenedMetaData/>


      Normally this works fine, but at some point Coldfusion adds an additional key to the getMetaData() results called skeleton which contains a Java object forcing the above line of code to error.

      This problem has been encountered before as mentioned in this post, but a solution was never mentioned:

      You’ll notice the article mention Coldfusion 6.1, but I have experienced it running Coldfusion 7.02, IIS 6 and ColdSpring-1.2-Patched

      Does anyone know why this is happening and if there is a solution to stop this from happening?