You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Robert Kornmesser (JIRA)" <ji...@apache.org> on 2012/07/23 08:55:34 UTC

[jira] [Comment Edited] (VFS-428) DavException: (301) Moved Permanently

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

Robert Kornmesser edited comment on VFS-428 at 7/23/12 6:53 AM:
----------------------------------------------------------------

Tried it inside my own project, because Maven Test still fails and I dont know if i can set a maven property to follow redirects.
To my own testcase fails to with this new error:
{code}

Unknown message with code "Unknown message with code "vfs.provider.webdav/propfind.error".".
org.apache.commons.vfs2.FileSystemException: Unknown message with code "Unknown message with code "vfs.provider.webdav/propfind.error".".
	at org.apache.commons.vfs2.provider.webdav.WebdavFileObject.doListChildrenResolved(WebdavFileObject.java:197)
	at org.apache.commons.vfs2.provider.AbstractFileObject.getChildren(AbstractFileObject.java:888)
	at de.gfz.liferay.hooks.mediaRepository.webdav.TestWebdav.testLogin(TestWebdav.java:37)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.apache.commons.vfs2.FileSystemException: Unknown message with code "vfs.provider.webdav/propfind.error".
	at org.apache.commons.vfs2.provider.webdav.WebdavFileObject.getProperties(WebdavFileObject.java:532)
	at org.apache.commons.vfs2.provider.webdav.WebdavFileObject.getProperties(WebdavFileObject.java:485)
	at org.apache.commons.vfs2.provider.webdav.WebdavFileObject.getProperty(WebdavFileObject.java:478)
	at org.apache.commons.vfs2.provider.webdav.WebdavFileObject.getProperty(WebdavFileObject.java:470)
	at org.apache.commons.vfs2.provider.webdav.WebdavFileObject.isDirectory(WebdavFileObject.java:450)
	at org.apache.commons.vfs2.provider.webdav.WebdavFileObject.doListChildrenResolved(WebdavFileObject.java:149)
	... 25 more
Caused by: java.lang.IllegalArgumentException: Entity enclosing requests cannot be redirected without user intervention
	at org.apache.commons.httpclient.methods.EntityEnclosingMethod.setFollowRedirects(EntityEnclosingMethod.java:221)
	at org.apache.commons.vfs2.provider.webdav.WebdavFileObject.setupMethod(WebdavFileObject.java:399)
	at org.apache.commons.vfs2.provider.webdav.WebdavFileObject.getProperties(WebdavFileObject.java:509)
	... 30 more
{code}
                
      was (Author: rkorn):
    Tried it inside my own project, because Maven Test still fails and I dont know if i can set a maven property to follow redirects.
To my own testcase fails to with this new error:
{code}
                  
> 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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira