[ 
https://issues.apache.org/jira/browse/VFS-428?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13586963#comment-13586963
 ] 

Jean-Marc Borer edited comment on VFS-428 at 2/26/13 9:38 AM:
--------------------------------------------------------------

I am having the same kind of issues. After a long investigation whith try and 
errors, I found out:
1) 
org.apache.commons.httpclient.methods.EntityEnclosingMethod.setFollowRedirects(false)
 is actually prevented by HTTPClient 3.x, because of RFC 2616. There is nothing 
you can do here. The solution would probably be to upgrade to HTTPClient 4, 
which seems to much better support redirection. However, even if VFS moves to 
the new version of HTTPClient, the Jackrabbit guys have not plans to upgrade: 
too much work and stick to to 3.x for a unknown time.
2) trailing slash support is tricky apparently. I need it also for supporting 
list feature with HTTP scheme. However internally VFS wants paths without 
trailing slashes. This is fine if your webserver is configured to redirect 
paths without trailing slash to trailing ones. However this is problematic when 
you try to access the same path with WebDAV (my case) where the redirection 
will not be supported.

Very tricky issue.
                
      was (Author: jmborer):
    I am having the same kind of issues. After a long investigation whith try 
and errors, I found out:
*) 
org.apache.commons.httpclient.methods.EntityEnclosingMethod.setFollowRedirects(false)
 is actually prevented by HTTPClient 3.x, because of RFC 2616. There is nothing 
you can do here. The solution would probably be to upgrade to HTTPClient 4, 
which seems to much better support redirection. However, even if VFS moves to 
the new version of HTTPClient, the Jackrabbit guys have not plans to upgrade: 
too much work and stick to to 3.x for a unknown time.
*) trailing slash support is tricky apparently. I need it also for supporting 
list feature with HTTP scheme. However internally VFS wants paths without 
trailing slashes. This is fine if your webserver is configured to redirect 
paths without trailing slash to trailing ones. However this is problematic when 
you try to access the same path with WebDAV (my case) where the redirection 
will not be supported.

Very tricky issue.
                  
> DavException: (301) Moved Permanently 
> --------------------------------------
>
>                 Key: VFS-428
>                 URL: https://issues.apache.org/jira/browse/VFS-428
>             Project: Commons VFS
>          Issue Type: Bug
>    Affects Versions: 2.0, 2.1
>         Environment: Apache 2.2.22 as Testerver and setted up like 
> http://commons.apache.org/vfs/testserver.html (but changed the 'crypt' 
> password)
>            Reporter: Robert Kornmesser
>            Priority: Blocker
>              Labels: webdav
>
> Running the WebdavProviderTestCase using mvn -P webdav clean test 
> -Dtest.webdav.uri=webdav://vfsusr:vfstest@localhost/vfstest 
> -Dtest=WebdavProviderTestCase results in 
> {code}DavException: (301) Moved Permanently
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.645 sec <<< 
> FAILURE!
> Results :
> Tests in error: 
>   
> junit.framework.TestSuite@55c9be00(org.apache.commons.vfs2.provider.webdav.test.WebdavProviderTestCase$1):
>  Could not determine the type of file 
> "webdav://vfsusr:****@localhost/vfstest/read-tests".
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
> {code}
> The deeper Problem is, that the HttpClient using by VFS does not append a 
> trailing slash and mod_dir of httpd has "DirectorySlash On" per default. So 
> httpd send 301 redirect to the same url with / appended.
> I know that for this reason of problematic webdav client apache introduced 
> "redirect-carefully" for some user agents using the "BrowserMatch" directive. 
> So I just tried adding the following into my <Directory> directive
> {code}
> BrowserMatch "^Jakarta-Commons-VFS" redirect-carefully
> BrowserMatch "^Jakarta Commons-HttpClient/3.0" redirect-carefully
> BrowserMatch "^Jakarta Commons-HttpClient/3.1" redirect-carefully
> {code}
> Its needed to have Jakarta-Commons-VFS *and* Jakarta Commons-HttpClient 
> because of two requests from commons vfs using two different user agents.
> But instead of solving the issue, I get for every FileObject.getChildren() 
> call at least one FileObject of type imaginary with the same basename as the 
> parent. Thats not a problem at all (besides that this is totally wrong!) but 
> deleting a parent just dont work anymore, because of an *non-existent* 
> imaginary file inside the dir which cannot be deleted of course.
> To cut a long story short, what is the right httpd webdav server config to 
> use 2.0 Release version of VFS?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to