Skip to main content
Participant
May 1, 2012
Question

Coldfusion 9.01 no longer recognizes virtual directories

  • May 1, 2012
  • 1 reply
  • 4478 views

Hi -

I have an application that has been working fine for over a year and now anything that references Virtual Directories no longer functions.  Here are the details:

Coldfusion is running on Windows Server 2003 Enterprise.

Using IIS6 for the web server on the same box.

I have several virtual directories setup that reference files on another server on the same network.

What I did to break things... I installed Apache (the latest release) along with PHP - but I set Apache up to listen on a different port (8080). Suddently any part of my code that tries to reference a file that is found through a virtual directory generates the following error:

An error occurred when performing a file operation exists on file /serverpdfs/130kPDFs/137485.pdf.

The cause of this exception was: org.apache.commons.vfs.FileSystemException: Could not determine the type of file "http://www.mybp-graphics.com/serverpdfs/130kPDFs/137485.pdf"..

Here's the actual code that generated that error:

<cfset filename = "http://www.mybp-graphics.com/serverpdfs/130kPDFs\137485.pdf">

    

     then within a table...

     <cfif FileExists("#filename#")>

    <td>Yes File</td>

    <cfelse>

    <td>No file</td>

    </cfif>

The "serverpdfs" is the virtual directory inside the website "mybp-graphics.com". If I look in IIS the directory is there, I can see all the files in it - it seems to be working fine.

I first experienced the problem when we tried to open a PDF for viewing by using <CFCONTENT> - the same type error occurs.

What is especially suspicious is that the exception was was "org.apache.commons.cfs.FileSystemException" - This error still persists even though I have done the following:

1.  Completely de-installed Apache and hid the PHP directory.

2.  Re-installed ColdFusion from scratch.

Any direction would be greatly appreciated - this error is affecting multiple modules of a website that is used constantly by both our customers and our internal employees.

If this should be posted in a different area of the forum please let me know.

Thanks

Curt

This topic has been closed for replies.

1 reply

Sean Coyne
Participating Frequently
May 1, 2012

FileExists is not designed to be used with a URL.  It takes an absolute path on disk or the vfs.  http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7c66.html

Sean Coyne
Participating Frequently
May 1, 2012

Also, if http://www.mybp-graphics.com/serverpdfs/130kPDFs/137485.pdf is really the URL you are using, it's returning a 500 error.  If that file exists, then IIS can't serve it.

clcatbpgAuthor
Participant
May 1, 2012

Sean,

Thanks for your reply - in regards to the "FileExists()" - I had set that up as a quick test and received the same error (essentially) as my primary code that is generating the eror. Below is the actual code that generates the error - along with the full output of the error message below;

The code calls another file to actually "push" the PDF I am trying to open - hopefully the code all makes sense. The CFSET code calculates the file name as files are stored in different sub-directories. This code has worked well for over a year.

As for the 500 error - I suspect that is a permissions issue - that folder is not publicly accessible - but it is to the coldfusion user account - and thus it serves it up.

Code:

------- Both the primary module and the called module ---

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Untitled Document</title>

</head>

<!--- This file calls the push file routine and passes along the parameters.  It also acts as the "shell" to open the new window.

          First we have to check and make sure that the random number matches up with the job number. --->


          <cfquery name="qRandom" datasource="BPOffice">

              SELECT           OrderNum, Random

        FROM           JobOrder_Data.db

        WHERE   (OrderNum = #URL.fn#) AND (Random = #URL.rnd#)

    </cfquery>

<body>  


          <cfif qRandom.RecordCount EQ 1>


        <cfset variables.MIMEType="application/pdf">     

        <cfset variables.FileName = "http://www.mybp-graphics.com/serverpdfs/" & "#(Int(URL.fn/10000)*10)#" & "kPDFs" & "#URL.fn#" & ".pdf">


        <cfset variables.Displaytype="inline">  

        <cf_pushfile

          FileName=#variables.FileName#

          MIMEType=#variables.MIMEType#

          DisplayType=#variables.DisplayType#>


    <cfelse>

           Error - no file found.

    </cfif>


</body>

</html>


======= Now the CF_PUSHFILE code ======


<cfset variables.FileToPush=attributes.FileName>

<cfheader

   name="content-disposition"

   value="#attributes.DisplayType#; filename=#attributes.FileName#">

<cfcontent

   type="#attributes.MIMEType#"

   file=#variables.FileToPush#>


==========END OF PUSHFILE CODE============

-----End of Code

Error:

An error occurred when performing a file operation exists on file /serverpdfs/130kPDFs/137623.pdf.

The cause of this exception was: org.apache.commons.vfs.FileSystemException: Could not determine the type of file "http://www.mybp-graphics.com/serverpdfs/130kPDFs/137623.pdf"..

The error occurred in C:/Inetpub/wwwroot/Paradox/open_pdf.cfm: line 38
36 : <cfheader name="Content-Disposition" value="inline; filename=#variables.ShortName#"> 37 : <cfheader name="Expires" value="#Now()#"> 38 : <cfcontent type="application/pdf" file="#variables.FileName#"> 39 : 40 :

Resources:
BrowserMozilla/5.0 (Windows NT 6.1) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19
Remote Address192.168.0.16
Referrerhttp://bpweb/paradox/ShowJobOrder.cfm?cfJobNumber=&CFGRIDKEY=137623
Date/Time01-May-12 12:19 PM
Stack Trace
at cfopen_pdf2ecfm1312221362.runPage(C:/Inetpub/wwwroot/Paradox/open_pdf.cfm:38) at cfopen_pdf2ecfm1312221362.runPage(C:/Inetpub/wwwroot/Paradox/open_pdf.cfm:38)

org.apache.commons.vfs.FileSystemException: Could not determine the type of file "http://www.mybp-graphics.com/serverpdfs/130kPDFs/137623.pdf". at org.apache.commons.vfs.provider.AbstractFileObject.attach(AbstractFileObject.java:1305) at org.apache.commons.vfs.provider.AbstractFileObject.getType(AbstractFileObject.java:412) at org.apache.commons.vfs.provider.AbstractFileObject.exists(AbstractFileObject.java:402) at coldfusion.vfs.VFile.exists(VFile.java:230) at coldfusion.tagext.net.ContentTag.doStartTag(ContentTag.java:178) at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2722) at cfopen_pdf2ecfm1312221362.runPage(C:\Inetpub\wwwroot\Paradox\open_pdf.cfm:38) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416) at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65) at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:381) at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48) at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40) at coldfusion.filter.PathFilter.invoke(PathFilter.java:94) at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70) at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28) at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38) at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46) at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62) at coldfusion.CfmServlet.service(CfmServlet.java:200) at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89) at jrun.servlet.FilterChain.doFilter(FilterChain.java:86) at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42) at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46) at jrun.servlet.FilterChain.doFilter(FilterChain.java:94) at jrun.servlet.FilterChain.service(FilterChain.java:101) at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106) at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42) at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286) at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543) at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203) at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320) at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428) at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266) at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66) Caused by: org.apache.commons.vfs.FileSystemException: HEAD method failed for "http://www.mybp-graphics.com/serverpdfs/130kPDFs/137623.pdf". at org.apache.commons.vfs.provider.http.HttpFileObject.doGetType(HttpFileObject.java:96) at org.apache.commons.vfs.provider.AbstractFileObject.attach(AbstractFileObject.java:1296) ... 36 more

----

As you'll notice I am getting the same "org.apache.commons.vfs" error as before.

Any further thoughts would be greatly appreciated.

Thanks

Curt