Session 在计划程序中运行Coldfusion 9会话变量时出错

Session 在计划程序中运行Coldfusion 9会话变量时出错,session,coldfusion,coldfusion-9,cfzip,Session,Coldfusion,Coldfusion 9,Cfzip,我有一个进程,当我手动运行它时,它运行良好,没有错误。我在CF管理员调度程序中设置了它,每天凌晨3:00运行。它每次都在同一行运行并出错。在过去的一周里,它已经做到了这一点。 错误:会话中未定义元素Date。包含或处理的文件的特定顺序是:C:\data\wwwroot\webapps\cfeis\commonapp\sftp\newpdfs.cfm,第45行 我知道这个session变量是存在的,因为它在几行之前就已经被使用过了,并且在那里工作得很好 <!---Loops through

我有一个进程,当我手动运行它时,它运行良好,没有错误。我在CF管理员调度程序中设置了它,每天凌晨3:00运行。它每次都在同一行运行并出错。在过去的一周里,它已经做到了这一点。 错误:会话中未定义元素Date。包含或处理的文件的特定顺序是:C:\data\wwwroot\webapps\cfeis\commonapp\sftp\newpdfs.cfm,第45行 我知道这个session变量是存在的,因为它在几行之前就已经被使用过了,并且在那里工作得很好

 <!---Loops through selected folder. If .zip found, extracts all files into same folder--->
<cftry>
  <cfdirectory action="list" directory="#dropfolder#\#session.datee#" name="listRoot">
  <cfloop query="listRoot">
  <!---<cfif #listroot.name# contains ".zip">--->
    <cfif #listroot.name# contains ".zip" and #listroot.name# contains "Writing">
      <cfset session.foldname=#left(listroot.name, len(listroot.name)-4)#>
      <cfif not DirectoryExists("#dropfolder#\#session.datee#\#session.foldname#")>
        <cfset DirectoryCreate("#dropfolder#\#session.datee#\#session.foldname#")>
      </cfif>
      <cftry>
        <cfzip action="unzip" destination="#dropfolder#\#session.datee#\#session.foldname#" file="#dropfolder#\#session.datee#\#listRoot.name#" overwrite="yes" recurse="yes">
        <cfcatch>
          <cfsavecontent variable= "mailmessage">
            <cfoutput>
              #cfcatch.message#
            </cfoutput>
          </cfsavecontent>
          <cfmail from="eis-distributed-apps@lists.gatech.edu" to="lauren.robinson@oit.gatech.edu" subject="Unzip error" type="html">
            <cfmailpart type="text/html" charset="utf-8">#mailmessage#</cfmailpart>
            <cfmailpart type="text/plain" charset="utf-8">#textMessage(mailmessage)#</cfmailpart>
          </cfmail>
        </cfcatch>
      </cftry>
    </cfif>
  </cfloop>
  <cfcatch>
  </cfcatch>
</cftry>

<cfset session.funzip=0>
<cfset session.funzipArr=ArrayNew(1)>
<cfset sleep(10000)>
<cfdirectory action="list" directory="#dropfolder#\#session.datee#\#session.foldname#" name="listRoot">
it errors所在的行是上面代码中显示的最后一行。正如您所看到的,相同的变量在代码中使用了3-4次。
有人能帮我理解是什么导致了这种情况吗?

会话和计划的任务通常不能一起工作。会话通常用作登录过程的一部分。没有用户可以登录计划的任务


如果这是您的完整代码,您可以将session.*替换为request.*

会话和计划任务通常不能一起工作。会话通常用作登录过程的一部分。没有用户可以登录计划的任务


如果这是您的完整代码,您可以将session.*替换为request.*

删除您的cftry标记,然后再次运行以查看错误。。。可能与您的会话变量有关。您值得将此代码提交到-在删除您的cftry标记并再次运行以查看错误是什么后,这里有很多可以改进的地方。。。可能与您的会话变量有关。您值得将此代码提交给—这里有很多地方可以改进