Ticket #319 (new defect)

Opened 8 months ago

numerous scaffolding coldspring errors on simple attempt to get it working

Reported by: rbrueske Owned by: kroche
Type: defect Priority: Highest
Milestone: Component: Scaffolding
Version: 5.5 Severity: blocker
Keywords: Cc:

Description

I've had a number of problems trying to get the scaffolding working. I tried creating scaffolding code for 1 table using coldspring. The code was generated, but I'm not sure I installed everything properly (the instructions with the scaffolding assume coldspring is already installed). I'm now getting error after error when I try and view the generated code.

my directory structure looks like this:

/coldspring
/customtags (my directory that contains the generated code)
/custotags/lexicon (i copied this directory from the /scaffolder/lexicon directory)
/scaffolder
/fusebox5

when I try and go to http://[dev server]/customfields I get the following error:
Bean creation exception in customfields.model.mPOGMDev.CFfieldDataService detail: Invalid CFML construct found on line 16 at column 24.:ColdFusion was looking at the following text:


The CFML compiler was processing:

  • a cfif tag beginning on line 16, column 18.
  • a cfif tag beginning on line 16, column 18.

:
Line: 16
Snippet:

<cfif >


The error occurred in C:\Inetpub\wwwroot\Dev\EvalueMDev\coldspring\beans\BeanDefinition?.cfc: line 569
Called from C:\Inetpub\wwwroot\Dev\EvalueMDev\coldspring\beans\BeanDefinition?.cfc: line 382
Called from C:\Inetpub\wwwroot\Dev\EvalueMDev\coldspring\beans\DefaultXmlBeanFactory?.cfc: line 663
Called from C:\Inetpub\wwwroot\Dev\EvalueMDev\coldspring\beans\DefaultXmlBeanFactory?.cfc: line 568
Called from C:\Inetpub\wwwroot\Dev\EvalueMDev\customfields\parsed\pogmdev.cffielddata_listing.cfm: line 54
Called from C:\Inetpub\wwwroot\Dev\EvalueMDev\fusebox5\Application.cfc: line 228
Called from C:\Inetpub\wwwroot\Dev\EvalueMDev\fusebox5\Application.cfc: line 218
Called from C:\Inetpub\wwwroot\Dev\EvalueMDev\fusebox5\fusebox5.cfm: line 57
Called from C:\Inetpub\wwwroot\Dev\EvalueMDev\customfields\index.cfm: line 1

567 : </cfif>
568 : <cfthrow type="coldspring.beanCreationException"
569 : message="Bean creation exception in #getBeanClass()# detail: #cfcatch.message#:#cfcatch.detail#:#additionalInfo#"
570 : >
571 : </cfcatch>

I found in /customfields/model/mPOGMDEV/generated/CFfieldDataService.cfc the following:

<cffunction name="getCFfieldData" access="public" output="false" returntype="CFfieldDataRecord">



<cfset var CFfieldData = createObject("component","CFfieldDataRecord").init(argumentCollection=arguments) />
<cfif >

<cfset variables.CFfieldDataDAO.read(CFfieldData) />

</cfif>
<cfreturn CFfieldData />

</cffunction>

I'm not sure what is supposed to be in the cfif statement. When I take it out, and run the code again, I get the following error:

[Macromedia][SQLServer JDBC Driver][SQLServer]Invalid object name 'CFfieldData'.


The error occurred in C:\Inetpub\wwwroot\Dev\EvalueMDev\customfields\model\mPOGMDev\generated\CFfieldDataGateway.cfc: line 86
Called from C:\Inetpub\wwwroot\Dev\EvalueMDev\customfields\model\mPOGMDev\generated\CFfieldDataService.cfc: line 33
Called from C:\Inetpub\wwwroot\Dev\EvalueMDev\customfields\parsed\pogmdev.cffielddata_listing.cfm: line 55
Called from C:\Inetpub\wwwroot\Dev\EvalueMDev\fusebox5\Application.cfc: line 228
Called from C:\Inetpub\wwwroot\Dev\EvalueMDev\fusebox5\Application.cfc: line 218
Called from C:\Inetpub\wwwroot\Dev\EvalueMDev\fusebox5\fusebox5.cfm: line 57
Called from C:\Inetpub\wwwroot\Dev\EvalueMDev\customfields\index.cfm: line 1

84 : <cfset var qList = "" />
85 :
86 : <cfquery name="qRecordCount" datasource="#variables.dsn#">
87 : SELECT COUNT(*) AS theRecordCount
88 : FROM CFfieldData

It appears that the table name had "tbl" removed from the beginning. There is some reference in the documentation:

The name of each object in the generated code is the name of the table it is generated from, with “tbl” removed from the start if necessary. You can change the generated name in the XML if required.

Obviously the table name must be correct in order to query it, so I'm not sure why the table name used in the generated query would be different. I did a search on the /customfields directory and found two references to "From CFfieldData", one in generated/CFfieldDataDAO.cfc and one in generated/CFfieldDataGateway.cfc

I changed these two references to use the correct table name, ran the page again and then got the following error:

Element _LISTSORTBYFIELDLIST is undefined in ATTRIBUTES.


The error occurred in C:\Inetpub\wwwroot\Dev\EvalueMDev\customfields\parsed\pogmdev.cffielddata_listing.cfm: line 59
Called from C:\Inetpub\wwwroot\Dev\EvalueMDev\fusebox5\Application.cfc: line 228
Called from C:\Inetpub\wwwroot\Dev\EvalueMDev\fusebox5\Application.cfc: line 218
Called from C:\Inetpub\wwwroot\Dev\EvalueMDev\fusebox5\fusebox5.cfm: line 57
Called from C:\Inetpub\wwwroot\Dev\EvalueMDev\customfields\index.cfm: line 1

57 : <cfset attributes._startrow = "#val((attributes._maxrows * ((attributes.totalRowCount - 1) \ attributes._maxrows)) + 1)#" />
58 : </cfif>
59 : <cfset qCFfieldData = "#variables.CFfieldDataService.getCFfieldDatas(sortByFieldList=attributes._listSortByFieldList,startrow=attributes._startRow,maxrows=attributes._maxrows)#" />
60 : <cfset fieldlist = "" />
61 : <cfset myFusebox.trace("Runtime","&lt;include template=""udf_appendParam.cfm"" circuit=""udfs""/&gt;") >

I'm not sure where _listSortByFieldList is supposed to be defined in order for this page to work. I added the following code to /customfields/controller/POGMDEV/circuit.xml.cfm:

<set name="attributes._listSortByFieldList" overwrite="false" value=""/>

I then run the page again, and get the following error:

[Macromedia][SQLServer JDBC Driver][SQLServer]Incorrect syntax near the keyword 'FROM'.


The error occurred in C:\Inetpub\wwwroot\Dev\EvalueMDev\customfields\model\mPOGMDev\generated\CFfieldDataGateway.cfc: line 55
Called from C:\Inetpub\wwwroot\Dev\EvalueMDev\customfields\model\mPOGMDev\generated\CFfieldDataService.cfc: line 43
Called from C:\Inetpub\wwwroot\Dev\EvalueMDev\customfields\parsed\pogmdev.cffielddata_listing.cfm: line 60
Called from C:\Inetpub\wwwroot\Dev\EvalueMDev\fusebox5\Application.cfc: line 228
Called from C:\Inetpub\wwwroot\Dev\EvalueMDev\fusebox5\Application.cfc: line 218
Called from C:\Inetpub\wwwroot\Dev\EvalueMDev\fusebox5\fusebox5.cfm: line 57
Called from C:\Inetpub\wwwroot\Dev\EvalueMDev\customfields\index.cfm: line 1

53 :
54 : ORDER BY #orderBy#
55 : </cfif>
56 : </cfquery>
57 :

Looking at the source code of /customfields/model/mPOGMDev/generated/CFfieldDataGateway.cfc I see this:
<cfquery name="qList" datasource="#variables.dsn#">

SELECT <cfif structKeyExists(arguments,"maxrows") AND arguments.maxrows GT 0>TOP #arguments.maxrows#</cfif>


FROM tblCFfieldData
WHERE 0=0


<cfif startrow IS NOT 1>

AND NOT IN(SELECT TOP #val(startrow - 1)# FROM tblCFfieldData WHERE 0=0


)

</cfif>
<!--- rmb * 01/14/2008 * commented out to see if I can get rid of the error that occurs when this function is called. --->
<cfif structKeyExists(arguments, "sortByFieldList") and len(arguments.sortByFieldList)>

<cfset orderBy = "">
<cfloop list="#arguments.sortByFieldList#" index="thisOrder">

<cfif ListGetAt?(thisOrder,3,"|") IS "ASC">

<cfset orderBy = ListAppend?(orderBy,"#ListGetAt?(thisOrder,1,'|')#.#ListGetAt?(thisOrder,2,'|')# ASC") />

<cfelse>

<cfset orderBy = ListAppend?(orderBy,"#ListGetAt?(thisOrder,1,'|')#.#ListGetAt?(thisOrder,2,'|')# DESC") />

</cfif>

</cfloop>


ORDER BY #orderBy#

</cfif>

</cfquery>

I added an asterisk after the maxrows count to prevent the sql syntax error. I ran the page again and got the following error:

Missing argument name.

When using named parameters to a function, every parameter must have a name.

The CFML compiler was processing:

  • an expression beginning with "appendParam", on line 84, column 42.This message is usually caused by a problem in the expressions structure.
  • The body of a cfoutput tag beginning on line 76, column 10.
  • The body of a cfoutput tag beginning on line 76, column 10.


The error occurred in C:\Inetpub\wwwroot\Dev\EvalueMDev\customfields\view\vPOGMDev\dsp_list_CFfieldData.cfm: line 84
Called from C:\Inetpub\wwwroot\Dev\EvalueMDev\customfields\parsed\pogmdev.cffielddata_listing.cfm: line 70
Called from C:\Inetpub\wwwroot\Dev\EvalueMDev\fusebox5\Application.cfc: line 228
Called from C:\Inetpub\wwwroot\Dev\EvalueMDev\fusebox5\Application.cfc: line 218
Called from C:\Inetpub\wwwroot\Dev\EvalueMDev\fusebox5\fusebox5.cfm: line 57
Called from C:\Inetpub\wwwroot\Dev\EvalueMDev\customfields\index.cfm: line 1

82 : </cfloop>
83 : <td align="center" class="standard">
84 : [<a href="#self##appendParam(appendParam(pageParams,"fuseaction",XFA.display),"",)#">View</a>]
85 : [<a href="#self##appendParam(appendParam(pageParams,"fuseaction",XFA.update),"",)#">Edit</a>]
86 : [<a href="#self##appendParam(appendParam(pageParams,"fuseaction",XFA.delete),"",)#">Delete</a>]

It appears that appendParam is listed twice. I removed the outer calls, ran the page again and got the following JRun servlet error:

500 (class: cfdsp_list_CFfieldData2ecfm1637512768, method: runPage signature: ()Ljava/lang/Object;) Inconsistent stack height 1 != 0
(class: cfdsp_list_CFfieldData2ecfm1637512768, method: runPage signature: ()Ljava/lang/Object;) Inconsistent stack height 1 != 0

I don't know what that is or what else might be wrong. Has anyone been able to get scaffolding to work without fuss?

Attachments

Note: See TracTickets for help on using tickets.