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/16 17:42:36 UTC
[jira] [Created] (VFS-428) DavException: (301) Moved Permanently
Robert Kornmesser created VFS-428:
-------------------------------------
Summary: 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
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://korni.gfz-potsdam.de/webdav/rz/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
[jira] [Updated] (VFS-428) DavException: (301) Moved Permanently
Posted by "Robert Kornmesser (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/VFS-428?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Robert Kornmesser updated VFS-428:
----------------------------------
Description:
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?
was:
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://korni.gfz-potsdam.de/webdav/rz/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?
> 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
[jira] [Commented] (VFS-428) DavException: (301) Moved Permanently
Posted by "Gary D. Gregory (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/VFS-428?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13425190#comment-13425190 ]
Gary D. Gregory commented on VFS-428:
-------------------------------------
Actually, now try from trunk please. I fixed VFS-434, which should give us the root cause in the stack trace!
> 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
[jira] [Comment Edited] (VFS-428) DavException: (301) Moved
Permanently
Posted by "Robert Kornmesser (JIRA)" <ji...@apache.org>.
[ 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
[jira] [Commented] (VFS-428) DavException: (301) Moved Permanently
Posted by "Gary D. Gregory (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/VFS-428?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13420150#comment-13420150 ]
Gary D. Gregory commented on VFS-428:
-------------------------------------
Some questions:
Are you saying that VFS should add a / to certain requests? Which ones?
Are you saying that this is a code bug or a documentation bug?
Should VFS offer an option to follow redirects?
Can you post your whole configuration with instructions such that it can be reproduced by anyone?
> 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
[jira] [Commented] (VFS-428) DavException: (301) Moved Permanently
Posted by "Gary D. Gregory (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/VFS-428?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13420415#comment-13420415 ]
Gary D. Gregory commented on VFS-428:
-------------------------------------
Please see VFS-432. Can you try the latest code from trunk?
> 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
[jira] [Commented] (VFS-428) DavException: (301) Moved Permanently
Posted by "Robert Kornmesser (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/VFS-428?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13425566#comment-13425566 ]
Robert Kornmesser commented on VFS-428:
---------------------------------------
{code}
Unknown message with code "Could not get property for: "webdav://vfsusr:***@localhost/vfstest/", name="webdav://vfsusr:***@localhost/vfstest/", type="0", nameSet="[{DAV:}resourcetype]", addEncoding="false".".
org.apache.commons.vfs2.FileSystemException: Unknown message with code "Could not get property for: "webdav://vfsusr:***@localhost/vfstest/", name="webdav://vfsusr:***@localhost/vfstest/", type="0", nameSet="[{DAV:}resourcetype]", addEncoding="false".".
at org.apache.commons.vfs2.provider.webdav.WebdavFileObject.doListChildrenResolved(WebdavFileObject.java:193)
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: Could not get property for: "webdav://vfsusr:***@localhost/vfstest/", name="webdav://vfsusr:***@localhost/vfstest/", type="0", nameSet="[{DAV:}resourcetype]", addEncoding="false".
at org.apache.commons.vfs2.provider.webdav.WebdavFileObject.getProperties(WebdavFileObject.java:528)
at org.apache.commons.vfs2.provider.webdav.WebdavFileObject.getProperties(WebdavFileObject.java:481)
at org.apache.commons.vfs2.provider.webdav.WebdavFileObject.getProperty(WebdavFileObject.java:474)
at org.apache.commons.vfs2.provider.webdav.WebdavFileObject.getProperty(WebdavFileObject.java:466)
at org.apache.commons.vfs2.provider.webdav.WebdavFileObject.isDirectory(WebdavFileObject.java:446)
at org.apache.commons.vfs2.provider.webdav.WebdavFileObject.doListChildrenResolved(WebdavFileObject.java:145)
... 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:225)
at org.apache.commons.vfs2.provider.webdav.WebdavFileObject.setupMethod(WebdavFileObject.java:395)
at org.apache.commons.vfs2.provider.webdav.WebdavFileObject.getProperties(WebdavFileObject.java:505)
... 30 more
{code}
The root cause was also visible before your update?!
{code}
Caused by: java.lang.IllegalArgumentException: Entity enclosing requests cannot be redirected without user intervention
at org.apache.commons.httpclient.methods.EntityEnclosingMethod.setFollowRedirects(EntityEnclosingMethod.java:225)
{code}
So httpclient already denies setFollowRedirect.
> 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
[jira] [Commented] (VFS-428) DavException: (301) Moved Permanently
Posted by "Gary D. Gregory (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/VFS-428?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13424933#comment-13424933 ]
Gary D. Gregory commented on VFS-428:
-------------------------------------
Hi Robert,
Can you please try again with latest from trunk?
I fixed VFS-433 which should give us a useful error message.
Thank you,
Gary
> 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
[jira] [Commented] (VFS-428) DavException: (301) Moved Permanently
Posted by "Robert Kornmesser (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/VFS-428?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13420153#comment-13420153 ]
Robert Kornmesser commented on VFS-428:
---------------------------------------
??Are you saying that VFS should add a / to certain requests? Which ones???
Yes and no. For sure requests to directories have to have a trailing slash. But of course VFS does not know at request level wich request is a possible directory. But Maybe the root request has to be a directory. so that this request should end with a /. From the root level on, VFS should know the directory structure.
??Are you saying that this is a code bug or a documentation bug???
Imho both! Requests to directories should either end with a trailing slash or the httpclient should be configurable to follow redirects. The documentation mentioned at http://commons.apache.org/vfs/testserver.html cann not work with the current code.
??Should VFS offer an option to follow redirects???
Yes, would be nice. I dont really know the webdav internals, why this denied by default.
??Can you post your whole configuration with instructions such that it can be reproduced by anyone???
*Webdav-Server*
* Apache HTTPD 2.2.22
* {code:title=/etc/apache2/conf.d/vfstest.conf|borderStyle=solid}
Alias /vfstest /vfstest/
DAVLockDB /var/lib/apache2/dav.lockDB
DAVMinTimeout 600
<Directory /vfstest>
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Location />
DAV On
Options Indexes MultiViews
AllowOverride None
AuthType Basic
AuthName vfstest_zone
AuthUserFile /etc/apache2/passwd
<Limit PUT POST DELETE PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
Require user vfsusr
</Limit>
</Location>
{code}
* htpasswd2 -cmb /etc/apache2/passwd vfsusr 'vfstest'
* {code:title=ls -R /vfstest/|borderStyle=solid}
/vfstest/:
insgesamt 3204
drwxr-xr-x 4 http http 4096 16. Jul 17:14 .
drwxr-xr-x 3 http http 4096 16. Jul 11:11 ..
-rw-r--r-- 1 http http 3130982 16. Jul 17:14 largefile.tar.gz
-rw-r--r-- 1 http http 1858 16. Jul 17:14 nested.jar
-rw-r--r-- 1 http http 40960 16. Jul 17:14 nested.tar
-rw-r--r-- 1 http http 1317 16. Jul 17:14 nested.tbz2
-rw-r--r-- 1 http http 1159 16. Jul 17:14 nested.tgz
-rw-r--r-- 1 http http 5028 16. Jul 17:14 nested.zip
drwxr-xr-x 3 http http 4096 16. Jul 17:14 read-tests
-rw-r--r-- 1 http http 106 16. Jul 17:14 test-hash-#test.txt
-rw-r--r-- 1 http http 4710 16. Jul 17:14 test.jar
-rw-r--r-- 1 http http 254 16. Jul 17:14 test.mf
-rw-r--r-- 1 http http 3211 16. Jul 17:14 test.policy
-rw-r--r-- 1 http http 30720 16. Jul 17:14 test.tar
-rw-r--r-- 1 http http 918 16. Jul 17:14 test.tbz2
-rw-r--r-- 1 http http 1001 16. Jul 17:14 test.tgz
-rw-r--r-- 1 http http 4880 16. Jul 17:14 test.zip
drwxr-xr-x 2 http http 4096 16. Jul 17:14 write-tests
/vfstest/read-tests:
insgesamt 24
drwxr-xr-x 3 http http 4096 16. Jul 17:14 .
drwxr-xr-x 4 http http 4096 16. Jul 17:14 ..
drwxr-xr-x 5 http http 4096 16. Jul 17:14 dir1
-rw-r--r-- 1 http http 0 16. Jul 17:14 empty.txt
-rw-r--r-- 1 http http 20 16. Jul 17:14 file1.txt
-rw-r--r-- 1 http http 20 16. Jul 17:14 file space.txt
-rw-r--r-- 1 http http 20 16. Jul 17:14 file%.txt
/vfstest/read-tests/dir1:
insgesamt 32
drwxr-xr-x 5 http http 4096 16. Jul 17:14 .
drwxr-xr-x 3 http http 4096 16. Jul 17:14 ..
-rw-r--r-- 1 http http 12 16. Jul 17:14 file1.txt
-rw-r--r-- 1 http http 12 16. Jul 17:14 file2.txt
-rw-r--r-- 1 http http 12 16. Jul 17:14 file3.txt
drwxr-xr-x 2 http http 4096 16. Jul 17:14 subdir1
drwxr-xr-x 2 http http 4096 16. Jul 17:14 subdir2
drwxr-xr-x 2 http http 4096 16. Jul 17:14 subdir3
/vfstest/read-tests/dir1/subdir1:
insgesamt 20
drwxr-xr-x 2 http http 4096 16. Jul 17:14 .
drwxr-xr-x 5 http http 4096 16. Jul 17:14 ..
-rw-r--r-- 1 http http 12 16. Jul 17:14 file1.txt
-rw-r--r-- 1 http http 12 16. Jul 17:14 file2.txt
-rw-r--r-- 1 http http 12 16. Jul 17:14 file3.txt
/vfstest/read-tests/dir1/subdir2:
insgesamt 20
drwxr-xr-x 2 http http 4096 16. Jul 17:14 .
drwxr-xr-x 5 http http 4096 16. Jul 17:14 ..
-rw-r--r-- 1 http http 12 16. Jul 17:14 file1.txt
-rw-r--r-- 1 http http 12 16. Jul 17:14 file2.txt
-rw-r--r-- 1 http http 12 16. Jul 17:14 file3.txt
/vfstest/read-tests/dir1/subdir3:
insgesamt 20
drwxr-xr-x 2 http http 4096 16. Jul 17:14 .
drwxr-xr-x 5 http http 4096 16. Jul 17:14 ..
-rw-r--r-- 1 http http 12 16. Jul 17:14 file1.txt
-rw-r--r-- 1 http http 12 16. Jul 17:14 file2.txt
-rw-r--r-- 1 http http 12 16. Jul 17:14 file3.txt
/vfstest/write-tests:
insgesamt 12
drwxr-xr-x 2 http http 4096 16. Jul 17:14 .
drwxr-xr-x 4 http http 4096 16. Jul 17:14 ..
-rw-r--r-- 1 http http 44 16. Jul 17:14 dummy.txt
{code}
* svn co http://svn.apache.org/repos/asf/commons/proper/vfs/tags/commons-vfs2-project-2.0/core/ /tmp/vfs2
* cd /tmp/vfs2
* {code:title=src/test/resources/log4j.properties|borderStyle=solid}
log4j.rootLogger=DEBUG, R
log4j.appender.R=org.apache.log4j.ConsoleAppender
log4j.appender.R.layout=org.apache.log4j.PatternLayout
og4j.appender.R.layout.ConversionPattern=%-4r %-5p [%t] %37c %3x - %m%n
{code}
* mvn -P webdav clean test -Dtest.webdav.uri=webdav://vfsusr:vfstest@localhost/vfstest -Dtest=WebdavProviderTestCase
* Result:
{code}
T E S T S
-------------------------------------------------------
Running org.apache.commons.vfs2.provider.webdav.test.WebdavProviderTestCase
Using "/tmp/vfs2/target/test-classes/test-data/temp" as temporary files store.
Set parameter http.useragent = Jakarta Commons-HttpClient/3.1
Set parameter http.protocol.version = HTTP/1.1
Set parameter http.connection-manager.class = class org.apache.commons.httpclient.SimpleHttpConnectionManager
Set parameter http.protocol.cookie-policy = default
Set parameter http.protocol.element-charset = US-ASCII
Set parameter http.protocol.content-charset = ISO-8859-1
Set parameter http.method.retry-handler = org.apache.commons.httpclient.DefaultHttpMethodRetryHandler@1c8a1c9d
Set parameter http.dateparser.patterns = [EEE, dd MMM yyyy HH:mm:ss zzz, EEEE, dd-MMM-yy HH:mm:ss zzz, EEE MMM d HH:mm:ss yyyy, EEE, dd-MMM-yyyy HH:mm:ss z, EEE, dd-MMM-yyyy HH-mm-ss z, EEE, dd MMM yy HH:mm:ss z, EEE dd-MMM-yyyy HH:mm:ss z, EEE dd MMM yyyy HH:mm:ss z, EEE dd-MMM-yyyy HH-mm-ss z, EEE dd-MMM-yy HH:mm:ss z, EEE dd MMM yy HH:mm:ss z, EEE,dd-MMM-yy HH:mm:ss z, EEE,dd-MMM-yyyy HH:mm:ss z, EEE, dd-MM-yyyy HH:mm:ss z]
Java version: 1.7.0_05
Java vendor: Oracle Corporation
Java class path: /tmp/vfs2/target/test-classes:/tmp/vfs2/target/classes:/home/setti/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar:/home/setti/.m2/repository/ant/ant/1.6.2/ant-1.6.2.jar:/home/setti/.m2/repository/commons-net/commons-net/2.2/commons-net-2.2.jar:/home/setti/.m2/repository/org/apache/commons/commons-compress/1.1/commons-compress-1.1.jar:/home/setti/.m2/repository/commons-collections/commons-collections/3.1/commons-collections-3.1.jar:/home/setti/.m2/repository/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar:/home/setti/.m2/repository/commons-codec/commons-codec/1.2/commons-codec-1.2.jar:/home/setti/.m2/repository/org/apache/jackrabbit/jackrabbit-webdav/1.5.2/jackrabbit-webdav-1.5.2.jar:/home/setti/.m2/repository/org/apache/jackrabbit/jackrabbit-jcr-commons/1.5.2/jackrabbit-jcr-commons-1.5.2.jar:/home/setti/.m2/repository/com/jcraft/jsch/0.1.42/jsch-0.1.42.jar:/home/setti/.m2/repository/junit/junit/4.8.2/junit-4.8.2.jar:/home/setti/.m2/repository/org/slf4j/slf4j-api/1.5.6/slf4j-api-1.5.6.jar:/home/setti/.m2/repository/org/slf4j/slf4j-log4j12/1.5.6/slf4j-log4j12-1.5.6.jar:/home/setti/.m2/repository/log4j/log4j/1.2.14/log4j-1.2.14.jar:/home/setti/.m2/repository/org/apache/maven/scm/maven-scm-api/1.4/maven-scm-api-1.4.jar:/home/setti/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.6/plexus-utils-1.5.6.jar:/home/setti/.m2/repository/org/apache/maven/scm/maven-scm-provider-svnexe/1.4/maven-scm-provider-svnexe-1.4.jar:/home/setti/.m2/repository/org/apache/maven/scm/maven-scm-provider-svn-commons/1.4/maven-scm-provider-svn-commons-1.4.jar:/home/setti/.m2/repository/regexp/regexp/1.3/regexp-1.3.jar:
Operating system name: Linux
Operating system architecture: amd64
Operating system version: 3.4.5-1-ARCH
SUN 1.7: SUN (DSA key/parameter generation; DSA signing; SHA-1, MD5 digests; SecureRandom; X.509 certificates; JKS keystore; PKIX CertPathValidator; PKIX CertPathBuilder; LDAP, Collection CertStores, JavaPolicy Policy; JavaLoginConfig Configuration)
SunRsaSign 1.7: Sun RSA signature provider
SunEC 1.7: Sun Elliptic Curve provider (EC, ECDSA, ECDH)
SunJSSE 1.7: Sun JSSE provider(PKCS12, SunX509 key/trust factories, SSLv3, TLSv1)
SunJCE 1.7: SunJCE Provider (implements RSA, DES, Triple DES, AES, Blowfish, ARCFOUR, RC2, PBE, Diffie-Hellman, HMAC)
SunJGSS 1.7: Sun (Kerberos v5, SPNEGO)
SunSASL 1.7: Sun SASL provider(implements client mechanisms for: DIGEST-MD5, GSSAPI, EXTERNAL, PLAIN, CRAM-MD5, NTLM; server mechanisms for: DIGEST-MD5, GSSAPI, CRAM-MD5, NTLM)
XMLDSig 1.0: XMLDSig (DOM XMLSignatureFactory; DOM KeyInfoFactory)
SunPCSC 1.7: Sun PC/SC provider
Set parameter http.connection-manager.max-per-host = {HostConfiguration[host=http://localhost]=5}
Set parameter http.connection-manager.max-total = 50
HttpConnectionManager.getConnection: config = HostConfiguration[host=http://localhost], timeout = 0
Allocating new connection, hostConfig=HostConfiguration[host=http://localhost]
Open connection to localhost:80
>> "HEAD / HTTP/1.1[\r][\n]"
Adding Host request header
>> "User-Agent: Jakarta Commons-HttpClient/3.1[\r][\n]"
>> "Host: localhost[\r][\n]"
>> "[\r][\n]"
<< "HTTP/1.1 200 OK[\r][\n]"
<< "HTTP/1.1 200 OK[\r][\n]"
<< "Date: Sun, 22 Jul 2012 12:45:12 GMT[\r][\n]"
<< "Server: Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/1.0.1c DAV/2 PHP/5.4.5[\r][\n]"
<< "Content-Type: text/html;charset=ISO-8859-1[\r][\n]"
<< "[\r][\n]"
Resorting to protocol version default close connection policy
Should NOT close connection, using HTTP/1.1
Releasing connection back to connection manager.
Freeing connection, hostConfig=HostConfiguration[host=http://localhost]
Adding connection at: 1342961112824
Notifying no-one, there are no waiting threads
putFile: webdav://vfsusr:vfstest@localhost/vfstest
putFile: webdav://vfsusr:vfstest@localhost/vfstest/read-tests
putFile: webdav://vfsusr:vfstest@localhost/vfstest/write-tests
HttpConnectionManager.getConnection: config = HostConfiguration[host=http://localhost], timeout = 0
Getting free connection, hostConfig=HostConfiguration[host=http://localhost]
>> "PROPFIND /vfstest/read-tests HTTP/1.1[\r][\n]"
Adding Host request header
>> "Depth: 0[\r][\n]"
>> "User-Agent: Jakarta-Commons-VFS[\r][\n]"
>> "Cache-control: no-cache[\r][\n]"
>> "Cache-store: no-store[\r][\n]"
>> "Pragma: no-cache[\r][\n]"
>> "Expires: 0[\r][\n]"
>> "Host: localhost[\r][\n]"
>> "Content-Length: 112[\r][\n]"
>> "Content-Type: text/xml; charset=UTF-8[\r][\n]"
>> "[\r][\n]"
>> "<?xml version="1.0" encoding="UTF-8"?><D:propfind xmlns:D="DAV:"><D:prop><D:resourcetype/></D:prop></D:propfind>"
Request body sent
<< "HTTP/1.1 401 Authorization Required[\r][\n]"
<< "HTTP/1.1 401 Authorization Required[\r][\n]"
<< "Date: Sun, 22 Jul 2012 12:45:12 GMT[\r][\n]"
<< "Server: Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/1.0.1c DAV/2 PHP/5.4.5[\r][\n]"
<< "WWW-Authenticate: Basic realm="vfstest_zone"[\r][\n]"
<< "Vary: accept-language,accept-charset[\r][\n]"
<< "Accept-Ranges: bytes[\r][\n]"
<< "Content-Length: 589[\r][\n]"
<< "Content-Type: text/html; charset=iso-8859-1[\r][\n]"
<< "Content-Language: en[\r][\n]"
<< "[\r][\n]"
Authorization required
Supported authentication schemes in the order of preference: [ntlm, digest, basic]
Challenge for ntlm authentication scheme not available
Challenge for digest authentication scheme not available
basic authentication scheme selected
Using authentication scheme: basic
Authorization challenge processed
Authentication scope: BASIC 'vfstest_zone'@localhost:80
Retry authentication
<< "<!--#set var="TITLE" value="Authentication required!"[\n]"
<< "--><!--#include virtual="include/top.html" -->[\n]"
<< "[\n]"
<< " This server could not verify that you are authorized to access[\n]"
<< " the URL "<!--#echo encoding="url" var="REDIRECT_URL" -->".[\n]"
<< " You either supplied the wrong credentials (e.g., bad password), or your[\n]"
<< " browser doesn't understand how to supply the credentials required.[\n]"
<< "[\n]"
<< " <!--#include virtual="include/spacer.html" -->[\n]"
<< "[\n]"
<< " In case you are allowed to request the document, please[\n]"
<< " check your user-id and password and try again.[\n]"
<< "[\n]"
<< "<!--#include virtual="include/bottom.html" -->[\n]"
Resorting to protocol version default close connection policy
Should NOT close connection, using HTTP/1.1
Authenticating with BASIC 'vfstest_zone'@localhost:80
Credential charset not configured, using HTTP element charset
>> "PROPFIND /vfstest/read-tests HTTP/1.1[\r][\n]"
Adding Host request header
>> "Depth: 0[\r][\n]"
>> "User-Agent: Jakarta-Commons-VFS[\r][\n]"
>> "Cache-control: no-cache[\r][\n]"
>> "Cache-store: no-store[\r][\n]"
>> "Pragma: no-cache[\r][\n]"
>> "Expires: 0[\r][\n]"
>> "Content-Length: 112[\r][\n]"
>> "Content-Type: text/xml; charset=UTF-8[\r][\n]"
>> "Authorization: Basic dmZzdXNyOnZmc3Rlc3Q=[\r][\n]"
>> "Host: localhost[\r][\n]"
>> "[\r][\n]"
>> "<?xml version="1.0" encoding="UTF-8"?><D:propfind xmlns:D="DAV:"><D:prop><D:resourcetype/></D:prop></D:propfind>"
Request body sent
<< "HTTP/1.1 301 Moved Permanently[\r][\n]"
<< "HTTP/1.1 301 Moved Permanently[\r][\n]"
<< "Date: Sun, 22 Jul 2012 12:45:12 GMT[\r][\n]"
<< "Server: Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/1.0.1c DAV/2 PHP/5.4.5[\r][\n]"
<< "Location: http://localhost/vfstest/read-tests/[\r][\n]"
<< "Content-Length: 363[\r][\n]"
<< "Content-Type: text/html; charset=iso-8859-1[\r][\n]"
<< "[\r][\n]"
Redirect required
<< "<"
<< "!"
<< "D"
<< "O"
<< "CTYPE HTML PUBLIC "-//IETF//"
<< "DTD HTML 2.0//EN">[\n]"
<< "<html><head>[\n]"
<< "<title>301 Moved Permanently</title>[\n]"
<< "</head><body>[\n]"
<< "<h1>Moved Permanently</h1>[\n]"
<< "<p>The document has moved <a href="http://localhost/vfstest/read-tests/">here</a>.</p>[\n]"
<< "<hr>[\n]"
<< "<address>Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/1.0.1c DAV/2 PHP/5.4.5 Server at localhost Port 80</address>[\n]"
<< "</body></html>[\n]"
Resorting to protocol version default close connection policy
Should NOT close connection, using HTTP/1.1
Releasing connection back to connection manager.
Freeing connection, hostConfig=HostConfiguration[host=http://localhost]
Adding connection at: 1342961112947
Notifying no-one, there are no waiting threads
DavException: (301) Moved Permanently
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.449 sec <<< FAILURE!
Results :
Tests in error:
junit.framework.TestSuite@3a2128d0(org.apache.commons.vfs2.provider.webdav.test.WebdavProviderTestSuite): Could not determine the type of file "webdav://vfsusr:***@localhost/vfstest/read-tests".
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
{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
[jira] [Commented] (VFS-428) DavException: (301) Moved Permanently
Posted by "Gary D. Gregory (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/VFS-428?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13425753#comment-13425753 ]
Gary D. Gregory commented on VFS-428:
-------------------------------------
I can see the root cause from your last post. I did not try the set up.
It looks like the HttpClient 3.1 implementation is correct. I read this Javadoc in {{org.apache.commons.httpclient.methods.EntityEnclosingMethod.setFollowRedirects(boolean)}}:
{quote}
Entity enclosing requests cannot be redirected without user intervention according to RFC 2616.
{quote}
In RFC 2616, section 10.3.2, I read:
{quote}
If the 301 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued.
{quote}
See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3
When I look at JackRabbit 1.6.5 (the WebDAV library VFS uses), I see a that JR uses a class called org.apache.jackrabbit.webdav.client.methods.PropFindMethod. This is a custom JR WebDAV class.
This explains the failure because it is neither an HTTP GET or HEAD.
I'm not sure what to do here. There are many newer versions of JR available but I've not upgraded VFS because JR no longer delivers an all-in-one jar.
You could try to use the current version of JR and see what happens. This may require changes to code and will certainly need some changes to the VFS POM.
> 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
[jira] [Commented] (VFS-428) DavException: (301) Moved Permanently
Posted by "Robert Kornmesser (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/VFS-428?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13420471#comment-13420471 ]
Robert Kornmesser commented on VFS-428:
---------------------------------------
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
[jira] [Commented] (VFS-428) DavException: (301) Moved Permanently
Posted by "Gary D. Gregory (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/VFS-428?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13424850#comment-13424850 ]
Gary D. Gregory commented on VFS-428:
-------------------------------------
Oops, looks like we have an unrelated bug, the error message is missing. I created VFS-433 to address this side 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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira