commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xratemx <xrat...@googlemail.com>
Subject [vfs] working with Webdav
Date Mon, 14 Jan 2013 16:22:13 GMT
hey, I am already using vfs successfully for downloading and uploading
files from different sources (like FTP) but I am not able to get it working
with webdav.
Resolving the provided url works fine. But when I try to check if the
objects exists Im getting the below exception.


used versions:
jackrabbit-webdav-2.4.3
commons-vfs2-2.0
running on jboss 5.1

//passing the username and passwords using the FileSystemOptions..
FileSystemOptions fileSystemOptions = new FileSystemOptions();
StaticUserAuthenticator auth = new
StaticUserAuthenticator(null,"myUsername", "myPassword");
try {
DefaultFileSystemConfigBuilder.getInstance().setUserAuthenticator(fileSystemOptions,
auth);
} catch (FileSystemException e2) {
//deal with exception
}


StandardFileSystemManager fsManager = new StandardFileSystemManager();
try {
fsManager.init();
} catch (FileSystemException e2) {
throw new RuntimeException("Can not create StandardFileSystemManager.",e2);
}



FileObject testFO = fsManager.resolveFile("webdav://
my_webdav_host.com/test/hello.txt", fileSystemOptions);
if(testFO.exists()) { <- produces exception
...
}



 java.lang.RuntimeException: org.apache.commons.vfs2.FileSystemException:
Could not determine the type of file "webdav://
my_webdav_host.com/test/hello.txt".
at
org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:77)
at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
at
org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:190)
at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at
org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at
org.jboss.ejb3.security.RoleBasedAuthorizationInterceptorv2.invoke(RoleBasedAuthorizationInterceptorv2.java:201)
at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at
org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:186)
at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at
org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at
org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at
org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at
org.jboss.ejb3.session.SessionSpecContainer.invoke(SessionSpecContainer.java:176)
at
org.jboss.ejb3.session.SessionSpecContainer.invoke(SessionSpecContainer.java:216)
at
org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:207)
at
org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:164)
at $Proxy794.uploadArchive(Unknown Source)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.RuntimeException:
org.apache.commons.vfs2.FileSystemException: Could not determine the type
of file "webdav://my_webdav_host.com/test/hello.txt".
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.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122)
at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
at
org.jboss.ejb3.EJBContainerInvocationWrapper.invokeNext(EJBContainerInvocationWrapper.java:69)
at
org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:73)
at
org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:59)
at sun.reflect.GeneratedMethodAccessor399.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174)
at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at
org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:72)
at
org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_2039683322.invoke(InvocationContextInterceptor_z_fillMethod_2039683322.java)
at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at
org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:88)
at
org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_2039683322.invoke(InvocationContextInterceptor_z_setup_2039683322.java)
at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at
org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62)
at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at
org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56)
at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at
org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at
org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:68)
at
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
... 24 more
Caused by: org.apache.commons.vfs2.FileSystemException: Could not determine
the type of file "webdav://my_webdav_host.com/test/hello.txt".
at
org.apache.commons.vfs2.provider.AbstractFileObject.getType(AbstractFileObject.java:505)
at
org.apache.commons.vfs2.provider.AbstractFileObject.exists(AbstractFileObject.java:477)
... 55 more
Caused by: org.apache.commons.vfs2.FileSystemException: Unknown message
with code "Found".
at
org.apache.commons.vfs2.provider.webdav.ExceptionConverter.generate(ExceptionConverter.java:89)
at
org.apache.commons.vfs2.provider.webdav.ExceptionConverter.generate(ExceptionConverter.java:42)
at
org.apache.commons.vfs2.provider.webdav.WebdavFileObject.execute(WebdavFileObject.java:435)
at
org.apache.commons.vfs2.provider.webdav.WebdavFileObject.getProperties(WebdavFileObject.java:510)
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.doGetType(WebdavFileObject.java:115)
at
org.apache.commons.vfs2.provider.AbstractFileObject.getType(AbstractFileObject.java:496)
... 57 more


Any help or guideline would be appreciated.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message