我有一个进程,当我手动运行它时,它运行得很好,没有任何错误。我在CF Administrator Scheduler中将其设置为每天凌晨3:00运行它每次都会在同一行运行并出错。在过去的一周里,它做到了这一点。
错误:会话中未定义元素DATEE。包含或处理的文件的特定顺序为: C:\data\wwwroot\webapps\cfeis\commonapp\sftp\newpdfs.cfm,行: 45
我知道这个会话变量是存在的,因为它之前用过几行,而且它在那里运行得很好。
<!---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">它出错的那一行是上面代码中显示的最后一行。正如您所看到的,相同的变量在前面的代码中使用了3-4次。有人能帮我弄清楚这是什么原因吗?
发布于 2013-12-10 23:06:25
会话和计划任务通常不能协同工作。会话通常用作登录过程的一部分。没有用户可以登录计划任务。
如果这是您的完整代码,您可以用request.*替换session.*
https://stackoverflow.com/questions/20497496
复制相似问题