0

I put my project on a new server where I am using ColdFusion 2016 but it is failing while running the following lines:

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

In ColdFusion 9, where my old server is, it is working just fine. Does anyone knows why this is happening and how to make this work for ColdFusion 2016? Here is a bigger picture of the code:

<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")>
DoArNa
  • 491
  • 2
  • 9
  • 29
  • I forgot to mention that I noticed that all the pages that are failing when moved to ColdFusion 2016 are the ones that have the option to download the data to CSV file!! – DoArNa Jul 24 '17 at 15:14

1 Answers1

0

I expect it has something to do with a missing Java dependency on the new server

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

For this to work it requires that the FastResultsetToFile class (or related JAR) is in one of the directories that ColdFusion uses for its classpath, otherwise it will never run.

William Greenly
  • 3,914
  • 20
  • 18