tracker issue : CF-3035890

select a category, or use search below
(searches all categories and all time range)
Title:

Bug 72767:I wished to test the virtual file system ram:///

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/

Reporter/Name(from Bugbase): A. Bakia / Alfred Bakia (A. Bakia)

Created: 08/21/2008

Components: File Management, VFS-RAM

Versions: 9.0

Failure Type: Unspecified

Found In Build/Fixed In Build: 0000 /

Priority/Frequency: Normal / Unknown

Locale/System: English / Win All

Vote Count: 1

Problem:

I wished to test the virtual file system ram:///. I used self-contained CFML code, which I stored as the file vfs_test.cfm. When I run it I get java.io.FileNotFoundException: ram:///a/b/dynamic.cfm. That is, Coldfusion apparently fails to find the file that is supposed to be in memory.

I found a workaround. The code works when I uncomment the line <cfdirectory action="create" directory="ram:///a/b/" />. For some reason, it continues to work even after I comment this line back again.

Method:

1) Save the following code as the file vfs_test.cfm:

<!--- Self-contained code: displays a list of names when run as a cfm page --->
<cfsavecontent variable="cfml">
<cfscript>
manager = createObject("java", "java.sql.DriverManager");
driver =createObject("java", "java.lang.Class").forName("org.apache.derby.jdbc.EmbeddedDriver");
connection = manager.getConnection("jdbc:derby:C:\ColdFusionCentaur\db\bookclub;create=false");
	statement      = connection.createStatement();
    resultSet      = statement.executeQuery("SELECT * FROM authors");
	while ( resultSet.next() ) {
      author = resultSet.getString("firstname") & " " & resultSet.getString("lastname");
      writeoutput(author & "<br>");
   }
</cfscript>
</cfsavecontent>

<!--- Seems to work only after I uncomment this line --->
<!--- <cfdirectory action="create" directory="ram:///a/b/" />  --->

<!--- Write the CFM data to an in-memory file --->
<cffile action="write" output="#cfml#" file="ram:///a/b/dynamic.cfm" /> 

<!--- cfinclude the file; the mapping vfs -> ram:///a/b/ is registered in the Administrator --->
<cfinclude template="/vfs/dynamic.cfm"> 

2) Create the mapping vfs -> ram:///a/b/ in the Coldfusion administrator;

3) Restart Coldfusion Centaur;

4) Run the page vfs_test.cfm. (This results in java.io.FileNotFoundException)

5) Uncomment the line <cfdirectory action="create" directory="ram:///a/b/" /> and run the page again. It should now work.

6) It continues to work even after you comment out the line in step 5 once again.  


Result:

An error occurred when performing a file operation write on file ram:///a/b/dynamic.cfm.  
The cause of this exception was: java.io.FileNotFoundException: ram:///a/b/dynamic.cfm.  
  
The error occurred in C:\ColdFusionCentaur\wwwroot\website\vfs_test.cfm: line 20
 
18 : 
19 : <!--- Write the CFM data to an in-memory file --->
20 : <cffile action="write" output="#cfml#" file="ram:///a/b/dynamic.cfm" /> 
21 : 

Stack Trace  
at cfvfs_test2ecfm883902832.runPage(C:\ColdFusionCentaur\wwwroot\website\vfs_test.cfm:20) at cfvfs_test2ecfm883902832.runPage(C:\ColdFusionCentaur\wwwroot\website\vfs_test.cfm:20) 


java.io.FileNotFoundException: ram:///a/b/dynamic.cfm
	at coldfusion.vfs.VFSFileFactory.fetchOutputStream(VFSFileFactory.java:387)
	at coldfusion.vfs.VFSFileFactory.getOutputStream(VFSFileFactory.java:273)
	at coldfusion.tagext.io.FileTag.createNewFile(FileTag.java:1015)
	at coldfusion.tagext.io.FileTag.write(FileTag.java:391)
	at coldfusion.tagext.io.FileTag.doStartTag(FileTag.java:300)
	at cfvfs_test2ecfm883902832.runPage(C:\ColdFusionCentaur\wwwroot\website\vfs_test.cfm:20)
	at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:196)
	at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:388)
	at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
	at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:273)
	at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
	at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
	at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
	at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)
	at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:74)
	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:53)
	at coldfusion.CfmServlet.service(CfmServlet.java:177)
	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.http.WebService.invokeRunnable(WebService.java:172)
	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)

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3035890

External Customer Info:
External Company:  
External Customer Name: Alfred Bakia
External Customer Email: 4E2913DC4455DE13992016B6
External Test Config: 08/21/2008

Attachments:

Comments:

I withdraw this submission. Therefore not a bug. Apparently, one has to first create the virtual directory ram:///a/b/ in memory before creating the file. It is so by design ( feedback from forum).
Vote by External U.
24790 | November 10, 2011 10:40:46 AM GMT