You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Philippe <d4...@protected32.unixadm.org> on 2014/07/01 18:37:00 UTC

tomcat8: delayed file operations with webdav

Hi,


I'm about to set up a webdav server on a stock Tomcat 8.0.9 (RHEL 6.5 
x86_64). To do so, I installed a dummy application with the web.xml 
attached to this message, altered the conf/tomcat-users.xml and started 
the tomcat server.

Now when uploading a file it doesn't show up immediately. Which is quite 
confusing for an application that does a PROPFIND right after PUTting 
the file, which results in a 404. Or, even worse, in a 500 when trying 
to MOVE or COPY the file.

Example:

(1)
> dav:/webdav/> ls
> Listing collection `/webdav/': collection is empty.
> dav:/webdav/> put testfile.bin
> Uploading testfile.bin to `/webdav/testfile.bin':
> Progress: [=============================>] 100,0% of 102400 bytes succeeded.
> dav:/webdav/> propget testfile.bin
> Fetching properties for `testfile.bin': failed:
> 404 Not Found
[now I'm waiting for a couple of seconds]
> dav:/webdav/> propget testfile.bin
> Fetching properties for `testfile.bin':
> DAV: creationdate = 2014-07-01T16:29:35Z
> DAV: displayname = testfile.bin
> DAV: getlastmodified = Tue, 01 Jul 2014 16:29:35 GMT
> DAV: getcontentlength = 102400
> DAV: getcontenttype = application/octet-stream
> DAV: getetag = W/"102400-1404232175000"
> DAV: resourcetype =
> DAV: source =
> DAV: supportedlock = <DAV:lockentry><DAV:lockscope><DAV:exclusive></DAV:exclusive></DAV:lockscope><DAV:locktype><DAV:write></DAV:write></DAV:locktype></DAV:lockentry><DAV:lockentry><DAV:lockscope><DAV:shared></DAV:shared></DAV:lockscope><DAV:locktype><DAV:write></DAV:write></DAV:locktype></DAV:lockentry>

(2)
> dav:/webdav/> rm testfile.bin
> Deleting `testfile.bin': succeeded.
> dav:/webdav/> ls
> Listing collection `/webdav/': collection is empty.
> dav:/webdav/> put testfile.bin testfile.bin.tmp
> Uploading testfile.bin to `/webdav/testfile.bin.tmp':
> Progress: [=============================>] 100,0% of 102400 bytes succeeded.
> dav:/webdav/> move testfile.bin.tmp testfile.bin
> Moving `/webdav/testfile.bin.tmp' to `/webdav/testfile.bin':  failed:
> 500 Internal Server Error
[again, waiting for a couple of seconds]
> dav:/webdav/> move testfile.bin.tmp testfile.bin
> Moving `/webdav/testfile.bin.tmp' to `/webdav/testfile.bin':  succeeded.

Why is tomcat behaving like this and how do I configure it to allow 
immediate file operations after upload?

AFAICT this is not a client issue. I've tested with cadaver, the Gnome 
and KDE file browsers and owncloud.


Kind regards,

Philippe

Re: tomcat8: delayed file operations with webdav

Posted by Konstantin Kolinko <kn...@gmail.com>.
2014-07-02 12:51 GMT+04:00 Philippe
<d4...@protected32.unixadm.org>:
> Ok, that's quite funny. With tomcat 6.0.41 and 7.0.54 the file is available
> immediately after upload (even without disabling the static resource
> caching). So either it's a bug or a feature in tomcat 8.
>

There is no such attribute as "cachingAllowed" on Context in Tomcat 8.
The attribute was moved to nested <Resources> element.
http://tomcat.apache.org/migration-8.html#Web_application_resources

Best regards,
Konstantin Kolinko

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


Re: tomcat8: delayed file operations with webdav

Posted by Philippe <d4...@protected32.unixadm.org>.
Ok, that's quite funny. With tomcat 6.0.41 and 7.0.54 the file is 
available immediately after upload (even without disabling the static 
resource caching). So either it's a bug or a feature in tomcat 8.

Regards,

Philippe


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


Re: tomcat8: delayed file operations with webdav

Posted by Philippe <d4...@protected32.unixadm.org>.
Hi Mark,


On 01.07.2014 18:40, Mark Thomas wrote:
> Try disabling static resource caching on the context.

thanks, but that didn't help.

conf/context.xml:
<Context cachingAllowed="false"> ...


Kind regards,

Philippe

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


Re: tomcat8: delayed file operations with webdav

Posted by Mark Thomas <ma...@apache.org>.
On 01/07/2014 17:37, Philippe wrote:
> Hi,
> 
> 
> I'm about to set up a webdav server on a stock Tomcat 8.0.9 (RHEL 6.5
> x86_64). To do so, I installed a dummy application with the web.xml
> attached to this message, altered the conf/tomcat-users.xml and started
> the tomcat server.
> 
> Now when uploading a file it doesn't show up immediately. Which is quite
> confusing for an application that does a PROPFIND right after PUTting
> the file, which results in a 404. Or, even worse, in a 500 when trying
> to MOVE or COPY the file.

Try disabling static resource caching on the context.

Mark


> 
> Example:
> 
> (1)
>> dav:/webdav/> ls
>> Listing collection `/webdav/': collection is empty.
>> dav:/webdav/> put testfile.bin
>> Uploading testfile.bin to `/webdav/testfile.bin':
>> Progress: [=============================>] 100,0% of 102400 bytes
>> succeeded.
>> dav:/webdav/> propget testfile.bin
>> Fetching properties for `testfile.bin': failed:
>> 404 Not Found
> [now I'm waiting for a couple of seconds]
>> dav:/webdav/> propget testfile.bin
>> Fetching properties for `testfile.bin':
>> DAV: creationdate = 2014-07-01T16:29:35Z
>> DAV: displayname = testfile.bin
>> DAV: getlastmodified = Tue, 01 Jul 2014 16:29:35 GMT
>> DAV: getcontentlength = 102400
>> DAV: getcontenttype = application/octet-stream
>> DAV: getetag = W/"102400-1404232175000"
>> DAV: resourcetype =
>> DAV: source =
>> DAV: supportedlock =
>> <DAV:lockentry><DAV:lockscope><DAV:exclusive></DAV:exclusive></DAV:lockscope><DAV:locktype><DAV:write></DAV:write></DAV:locktype></DAV:lockentry><DAV:lockentry><DAV:lockscope><DAV:shared></DAV:shared></DAV:lockscope><DAV:locktype><DAV:write></DAV:write></DAV:locktype></DAV:lockentry>
>>
> 
> (2)
>> dav:/webdav/> rm testfile.bin
>> Deleting `testfile.bin': succeeded.
>> dav:/webdav/> ls
>> Listing collection `/webdav/': collection is empty.
>> dav:/webdav/> put testfile.bin testfile.bin.tmp
>> Uploading testfile.bin to `/webdav/testfile.bin.tmp':
>> Progress: [=============================>] 100,0% of 102400 bytes
>> succeeded.
>> dav:/webdav/> move testfile.bin.tmp testfile.bin
>> Moving `/webdav/testfile.bin.tmp' to `/webdav/testfile.bin':  failed:
>> 500 Internal Server Error
> [again, waiting for a couple of seconds]
>> dav:/webdav/> move testfile.bin.tmp testfile.bin
>> Moving `/webdav/testfile.bin.tmp' to `/webdav/testfile.bin':  succeeded.
> 
> Why is tomcat behaving like this and how do I configure it to allow
> immediate file operations after upload?
> 
> AFAICT this is not a client issue. I've tested with cadaver, the Gnome
> and KDE file browsers and owncloud.
> 
> 
> Kind regards,
> 
> Philippe
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


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