You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mick Semb Wever <mi...@semb.wever.org> on 2008/02/15 22:30:09 UTC

FileDirContext fails to immediately recognise new files

My application writes new files out into the container's webapps/ROOT/ 
directory.

But servletContext.getResource(..) returns null if it is called too 
quickly after the file has been created.

This can be debugged all the way down to FileDirContext simply not 
finding the file. Funny when "new File("new-file").exists()" always 
returns true for me immediately after i've created the file. i *am* using 
a FileChannel and calling force(true) to finish with.

Does FileDirContext have some "checkInterval" attribute, similar to how 
JspServlet, that specifies how long it takes before new files are 
recognised?

~mck


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: FileDirContext fails to immediately recognise new files

Posted by Mick Semb Wever <mi...@semb.wever.org>.

> assign the classname attr inside the <Resource element
>  classname=org.apache.naming.resources.FileDirContext
> 
> http://dspace.dsto.defence.gov.au/tomcat-docs/config/resources.html
> 
Sorry for asking so hastily.
Seems to work well with
META-INF/context.xml:
<Context cachingAllowed="false" />

Thanks very much for pointing me in the right direction!

~mck

-- 
"When there is no enemy within, the enemies outside can't hurt you." 
African proverb 
| Homepage - www.wever.org | Sesam Search Engine - www.sesam.no |


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: FileDirContext fails to immediately recognise new files

Posted by Mick Semb Wever <mi...@semb.wever.org>.
> assign the classname attr inside the <Resource element
>  classname=org.apache.naming.resources.FileDirContext
> 
> http://dspace.dsto.defence.gov.au/tomcat-docs/config/resources.html
> 

Sorry for asking so hastily.
Seems to work well with
META-INF/context.xml:
<Context cachingAllowed="false" />

Thanks very much for pointing me in the right direction!

~mck

-- 
"When there is no enemy within, the enemies outside can't hurt you." 
African proverb 
| Homepage - www.wever.org | Sesam Search Engine - www.sesam.no |



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org