0

我将项目放在使用 ColdFusion 2016 的新服务器上,但在运行以下行时失败:

<cfset fastFileWriter = createObject("java", "FastResultsetToFile")>
<cfset fastFileWriter.exportResultsetToFile(myQuery, "#TempFile#", ',', "UTF-8")> 

在我的旧服务器所在的 ColdFusion 9 中,它工作得很好。有谁知道为什么会发生这种情况以及如何使其适用于 ColdFusion 2016?这是代码的大图:

<cfset yopath = "#application.masterpath#/platform_a/reports/pods/#pid#" />
<cfset acfile = "outbound_export_#session.callmeasurement_uid#.csv" />
<cfset TempFile = "#yopath#/#acfile#">

<cfif FileExists(TempFile)>
    <cffile action="delete" file="#TempFile#" >
</cfif>

<cfset myQuery = QueryNew("Team_Member, Calls, Unique, Live_Connections, Rescued_Calls")>

<cfloop query = "pull_staff">
    <cfset newrow = QueryAddRow(myQuery,1)>
    <cfset temp = QuerySetCell(myQuery, 'Team_Member', #lename#)>
    <cfset temp = QuerySetCell(myQuery, 'Calls', #all_calls#)>
    <cfset temp = QuerySetCell(myQuery, 'Unique', #unique_calls#)>
    <cfset temp = QuerySetCell(myQuery, 'Live_Connections', #live_convo#)>
    <cfset temp = QuerySetCell(myQuery, 'Rescued_Calls', #rescued#)>
</cfloop>

<!--- The code is running just fine up to this point. I used a cfdump to check the query "pull_staff" and it is returning the right results with correct column names --->
<cfset fastFileWriter = createObject("java", "FastResultsetToFile")>
<cfset fastFileWriter.exportResultsetToFile(myQuery, "#TempFile#", ',', "UTF-8")>
4

1 回答 1

0

我希望这与新服务器上缺少 Java 依赖项有关

<cfset fastFileWriter = createObject("java", "FastResultsetToFile")>

为此,它需要 FastResultsetToFile 类(或相关 JAR)位于 ColdFusion 用于其类路径的目录之一中,否则它将永远不会运行。

于 2017-07-24T15:17:31.937 回答