Re: [VFS][WebDAV] access throws ClassCastException: ArrayList cannot be cast Node

2014-08-01 Thread Bernd Eckenfels
Hello Jörg,

is this (or a similiar installation) somewhere available over the
internet, I would like to debug what types are returned here.

(I am not sure I understand what this has to do with XMLConfiguration)

I dont think it is a problem of your code, that casting problem should
never happen. Feel free to open a Jira Bug for it.

https://issues.apache.org/jira/browse/VFS

Gruss
Bernd


 Am Fri, 1
Aug 2014 11:26:09 +0200 schrieb Jörg Wille :

> @Gary: I am using 2.1-SNAPSHOT Rev.:1609711
> @Martin: I can understand - to an extent - what you write about the
> difference between XMLConfiguration and PropertyConfiguration.
> But can you explain why is this topic special to webdav in general or
> maybe only in combination with Alfresco?
> And most importantly, how can I get WebDav to work? From reading on
> the projects's web-site, I was in the believe that WebDav is a
> supported filesystem.
> Am I doing something wrong in my code? Are there any examples I can
> have a look at?
> 

-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



[vfs] webdav access throws ClassCastException: ArrayList cannot be cast Node

2014-08-01 Thread Jörg Wille
@Gary: I am using 2.1-SNAPSHOT Rev.:1609711
@Martin: I can understand - to an extent - what you write about the
difference between XMLConfiguration and PropertyConfiguration.
But can you explain why is this topic special to webdav in general or maybe
only in combination with Alfresco?
And most importantly, how can I get WebDav to work? From reading on the
projects's web-site, I was in the believe that WebDav is a supported
filesystem.
Am I doing something wrong in my code? Are there any examples I can have a
look at?


RE: [vfs] webdav access throws ClassCastException: ArrayList cannot be cast Node

2014-07-31 Thread Martin Gainty
org.w3c.dom.Node is at the heart of XML and is used by SAX,DOM and STAX
org.w3c.dom is currently not used by the Following implementations in 
commons-configurations:
properties
FileSystems such as VFS or Hadoop FS
DB 
unless of course we convert Properties/VFSFileEntitiesHadoop/DB to XML DOM Node 
which is not happening

to resolve these 2 distinct implementation paths i suggested a split in 
Functionality
one for XML (org.w3c.dom.Node)
and one for Properties/VFS/HDFS/DBEntities
So the solution seems to be a re-architecture...I have something running 
locally on my box which scans the file extension and then sets up the correct 
digesterRules and then sets up the XMLConfiguration for XML
but then uses PropertiesConfiguration for files which use a 
PropertyConfiguration for 
Properties, VFS, HadoopFS, DB

you can see clearly see this distinction in the rules initialisation within 
ConfigurationFactory.java
protected void initDigesterSectionRules(Digester digester, String matchString, 
boolean additional)

Martin


> Date: Thu, 31 Jul 2014 18:54:44 -0400
> Subject: Re: [vfs] webdav access throws ClassCastException: ArrayList cannot 
> be cast Node
> From: garydgreg...@gmail.com
> To: user@commons.apache.org
> 
> Is this in 2.0 or using the trunk version? If not trunk, can you check out
> trunk and test your scenario?
> 
> Gayr
> 
> 
> On Thu, Jul 31, 2014 at 4:43 PM, Jörg Wille  wrote:
> 
> > This is the first time I use VFS. But local and http file access works.
> > But using webdav (with *Alfresco* as server) does not work.
> > The Problem is similar to this one:
> >
> > http://mail-archives.apache.org/mod_mbox/commons-user/201109.mbox/%3C004001cc769b$ff3e6770$fdbb3650$@queres.com%3E
> >
> > *I am doing the following:*
> >
> > private static final String URL = "webdav://
> > admin:alfresco@192.168.66.124:8080/alfresco/webdav/firmware/";
> > DefaultFileSystemManager manager = new DefaultFileSystemManager();
> > manager.addProvider("file", new DefaultLocalFileProvider());
> > manager.addProvider("http", new HttpFileProvider());
> > manager.addProvider("webdav", new WebdavFileProvider());
> > manager.setCacheStrategy(CacheStrategy.ON_RESOLVE);
> > manager.setFilesCache(new SoftRefFilesCache());
> > manager.init();
> > final FileObject fileObject = manager.resolveFile(URL)
> > System.out.println("Name:" + fileObject.getName());
> > System.out.println("Attached:" + fileObject.isAttached());
> > try {
> > fileObject.isReadable();
> > } catch (Exception e) {
> > System.out.println("Message: " + e.getMessage() + "\nCause: " +
> > e.getCause()+ "\nStacktrace: " + getStackTrace(e));
> > }
> > try {
> > fileObject.getChildren();
> > } catch (Exception e) {
> > System.out.println("Message: " + e.getMessage() + "\nCause: " +
> > e.getCause()+ "\nStacktrace: " + getStackTrace(e));
> > }
> > try {
> > fileObject.isFolder();
> > } catch (Exception e) {
> > System.out.println("Message: " + e.getMessage() + "\nCause: " +
> > e.getCause()+ "\nStacktrace: " + getStackTrace(e));
> > }
> >
> > *Result:*
> >
> > Name:webdav://admin:alfresco@192.168.66.124:8080/alfresco/webdav/firmware/
> >
> > *Attached:false*
> >
> > Message: Could not determine if file "webdav://admin:***@
> > 192.168.66.124:8080/alfresco/webdav/firmware/" is readable.
> >
> > Cause: org.apache.commons.vfs2.FileSystemException: Could not determine the
> > type of file "webdav://admin:***@
> > 192.168.66.124:8080/alfresco/webdav/firmware/".
> >
> > Stacktrace: org.apache.commons.vfs2.FileSystemException: Could not
> > determine if file "webdav://admin:***@
> > 192.168.66.124:8080/alfresco/webdav/firmware/" is readable.
> >
> > …
> >
> > Caused by: java.lang.ClassCastException: java.util.ArrayList cannot be cast
> > to org.w3c.dom.Node
> >
> > at
> >
> > org.apache.commons.vfs2.provider.webdav.WebdavFileObject.isDirectory(WebdavFileObject.java:718)
> >
> > at
> >
> > org.apache.commons.vfs2.provider.webdav.WebdavFileObject.doGetType(WebdavFileObject.java:405)
> >
> > at
> >
> > org.apache.commons.vfs2.provider.AbstractFileObject.getType(AbstractFileObject.java:1497)
> >
> > ... 57 more
> >
> >
> > Message: Could not list the contents of folder "webdav://admin:***@
> > 192.168.66.124:8080/alfresco/webdav/firmware/".
> >
> > Cause

Re: [vfs] webdav access throws ClassCastException: ArrayList cannot be cast Node

2014-07-31 Thread Gary Gregory
Is this in 2.0 or using the trunk version? If not trunk, can you check out
trunk and test your scenario?

Gayr


On Thu, Jul 31, 2014 at 4:43 PM, Jörg Wille  wrote:

> This is the first time I use VFS. But local and http file access works.
> But using webdav (with *Alfresco* as server) does not work.
> The Problem is similar to this one:
>
> http://mail-archives.apache.org/mod_mbox/commons-user/201109.mbox/%3C004001cc769b$ff3e6770$fdbb3650$@queres.com%3E
>
> *I am doing the following:*
>
> private static final String URL = "webdav://
> admin:alfresco@192.168.66.124:8080/alfresco/webdav/firmware/";
> DefaultFileSystemManager manager = new DefaultFileSystemManager();
> manager.addProvider("file", new DefaultLocalFileProvider());
> manager.addProvider("http", new HttpFileProvider());
> manager.addProvider("webdav", new WebdavFileProvider());
> manager.setCacheStrategy(CacheStrategy.ON_RESOLVE);
> manager.setFilesCache(new SoftRefFilesCache());
> manager.init();
> final FileObject fileObject = manager.resolveFile(URL)
> System.out.println("Name:" + fileObject.getName());
> System.out.println("Attached:" + fileObject.isAttached());
> try {
> fileObject.isReadable();
> } catch (Exception e) {
> System.out.println("Message: " + e.getMessage() + "\nCause: " +
> e.getCause()+ "\nStacktrace: " + getStackTrace(e));
> }
> try {
> fileObject.getChildren();
> } catch (Exception e) {
> System.out.println("Message: " + e.getMessage() + "\nCause: " +
> e.getCause()+ "\nStacktrace: " + getStackTrace(e));
> }
> try {
> fileObject.isFolder();
> } catch (Exception e) {
> System.out.println("Message: " + e.getMessage() + "\nCause: " +
> e.getCause()+ "\nStacktrace: " + getStackTrace(e));
> }
>
> *Result:*
>
> Name:webdav://admin:alfresco@192.168.66.124:8080/alfresco/webdav/firmware/
>
> *Attached:false*
>
> Message: Could not determine if file "webdav://admin:***@
> 192.168.66.124:8080/alfresco/webdav/firmware/" is readable.
>
> Cause: org.apache.commons.vfs2.FileSystemException: Could not determine the
> type of file "webdav://admin:***@
> 192.168.66.124:8080/alfresco/webdav/firmware/".
>
> Stacktrace: org.apache.commons.vfs2.FileSystemException: Could not
> determine if file "webdav://admin:***@
> 192.168.66.124:8080/alfresco/webdav/firmware/" is readable.
>
> …
>
> Caused by: java.lang.ClassCastException: java.util.ArrayList cannot be cast
> to org.w3c.dom.Node
>
> at
>
> org.apache.commons.vfs2.provider.webdav.WebdavFileObject.isDirectory(WebdavFileObject.java:718)
>
> at
>
> org.apache.commons.vfs2.provider.webdav.WebdavFileObject.doGetType(WebdavFileObject.java:405)
>
> at
>
> org.apache.commons.vfs2.provider.AbstractFileObject.getType(AbstractFileObject.java:1497)
>
> ... 57 more
>
>
> Message: Could not list the contents of folder "webdav://admin:***@
> 192.168.66.124:8080/alfresco/webdav/firmware/".
>
> Cause: java.lang.ClassCastException: java.util.ArrayList cannot be cast to
> org.w3c.dom.Node
>
> Stacktrace: org.apache.commons.vfs2.FileSystemException: Could not list the
> contents of folder "webdav://admin:***@
> 192.168.66.124:8080/alfresco/webdav/firmware/".
>
> …
>
> Caused by: java.lang.ClassCastException: java.util.ArrayList cannot be cast
> to org.w3c.dom.Node
>
> at
>
> org.apache.commons.vfs2.provider.webdav.WebdavFileObject.isDirectory(WebdavFileObject.java:718)
>
> at
>
> org.apache.commons.vfs2.provider.webdav.WebdavFileObject.doListChildrenResolved(WebdavFileObject.java:453)
>
> at
>
> org.apache.commons.vfs2.provider.AbstractFileObject.getChildren(AbstractFileObject.java:1147)
>
> ... 55 more
>
>
> Message: Could not determine the type of file "webdav://admin:***@
> 192.168.66.124:8080/alfresco/webdav/firmware/".
>
> Cause: java.lang.ClassCastException: java.util.ArrayList cannot be cast to
> org.w3c.dom.Node
>
> Stacktrace: org.apache.commons.vfs2.FileSystemException: Could not
> determine the type of file "webdav://admin:***@
> 192.168.66.124:8080/alfresco/webdav/firmware/".
>
> …
>
> Caused by: java.lang.ClassCastException: java.util.ArrayList cannot be cast
> to org.w3c.dom.Node
>
> at
>
> org.apache.commons.vfs2.provider.webdav.WebdavFileObject.isDirectory(WebdavFileObject.java:718)
>
> at
>
> org.apache.commons.vfs2.provider.webdav.WebdavFileObject.doGetType(WebdavFileObject.java:405)
>
> at
>
> org.apache.commons.vfs2.provider.AbstractFileObject.getType(AbstractFileObject.java:1497)
>
> ... 56 more
>
> What am I doing wrong? And what does "Attached:false" means?
>



-- 
E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
Java Persistence with Hibernate, Second Edition

JUnit in Action, Second Edition 
Spring Batch in Action 
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory


[vfs] webdav access throws ClassCastException: ArrayList cannot be cast Node

2014-07-31 Thread Jörg Wille
This is the first time I use VFS. But local and http file access works.
But using webdav (with *Alfresco* as server) does not work.
The Problem is similar to this one:
http://mail-archives.apache.org/mod_mbox/commons-user/201109.mbox/%3C004001cc769b$ff3e6770$fdbb3650$@queres.com%3E

*I am doing the following:*

private static final String URL = "webdav://
admin:alfresco@192.168.66.124:8080/alfresco/webdav/firmware/";
DefaultFileSystemManager manager = new DefaultFileSystemManager();
manager.addProvider("file", new DefaultLocalFileProvider());
manager.addProvider("http", new HttpFileProvider());
manager.addProvider("webdav", new WebdavFileProvider());
manager.setCacheStrategy(CacheStrategy.ON_RESOLVE);
manager.setFilesCache(new SoftRefFilesCache());
manager.init();
final FileObject fileObject = manager.resolveFile(URL)
System.out.println("Name:" + fileObject.getName());
System.out.println("Attached:" + fileObject.isAttached());
try {
fileObject.isReadable();
} catch (Exception e) {
System.out.println("Message: " + e.getMessage() + "\nCause: " +
e.getCause()+ "\nStacktrace: " + getStackTrace(e));
}
try {
fileObject.getChildren();
} catch (Exception e) {
System.out.println("Message: " + e.getMessage() + "\nCause: " +
e.getCause()+ "\nStacktrace: " + getStackTrace(e));
}
try {
fileObject.isFolder();
} catch (Exception e) {
System.out.println("Message: " + e.getMessage() + "\nCause: " +
e.getCause()+ "\nStacktrace: " + getStackTrace(e));
}

*Result:*

Name:webdav://admin:alfresco@192.168.66.124:8080/alfresco/webdav/firmware/

*Attached:false*

Message: Could not determine if file "webdav://admin:***@
192.168.66.124:8080/alfresco/webdav/firmware/" is readable.

Cause: org.apache.commons.vfs2.FileSystemException: Could not determine the
type of file "webdav://admin:***@
192.168.66.124:8080/alfresco/webdav/firmware/".

Stacktrace: org.apache.commons.vfs2.FileSystemException: Could not
determine if file "webdav://admin:***@
192.168.66.124:8080/alfresco/webdav/firmware/" is readable.

…

Caused by: java.lang.ClassCastException: java.util.ArrayList cannot be cast
to org.w3c.dom.Node

at
org.apache.commons.vfs2.provider.webdav.WebdavFileObject.isDirectory(WebdavFileObject.java:718)

at
org.apache.commons.vfs2.provider.webdav.WebdavFileObject.doGetType(WebdavFileObject.java:405)

at
org.apache.commons.vfs2.provider.AbstractFileObject.getType(AbstractFileObject.java:1497)

... 57 more


Message: Could not list the contents of folder "webdav://admin:***@
192.168.66.124:8080/alfresco/webdav/firmware/".

Cause: java.lang.ClassCastException: java.util.ArrayList cannot be cast to
org.w3c.dom.Node

Stacktrace: org.apache.commons.vfs2.FileSystemException: Could not list the
contents of folder "webdav://admin:***@
192.168.66.124:8080/alfresco/webdav/firmware/".

…

Caused by: java.lang.ClassCastException: java.util.ArrayList cannot be cast
to org.w3c.dom.Node

at
org.apache.commons.vfs2.provider.webdav.WebdavFileObject.isDirectory(WebdavFileObject.java:718)

at
org.apache.commons.vfs2.provider.webdav.WebdavFileObject.doListChildrenResolved(WebdavFileObject.java:453)

at
org.apache.commons.vfs2.provider.AbstractFileObject.getChildren(AbstractFileObject.java:1147)

... 55 more


Message: Could not determine the type of file "webdav://admin:***@
192.168.66.124:8080/alfresco/webdav/firmware/".

Cause: java.lang.ClassCastException: java.util.ArrayList cannot be cast to
org.w3c.dom.Node

Stacktrace: org.apache.commons.vfs2.FileSystemException: Could not
determine the type of file "webdav://admin:***@
192.168.66.124:8080/alfresco/webdav/firmware/".

…

Caused by: java.lang.ClassCastException: java.util.ArrayList cannot be cast
to org.w3c.dom.Node

at
org.apache.commons.vfs2.provider.webdav.WebdavFileObject.isDirectory(WebdavFileObject.java:718)

at
org.apache.commons.vfs2.provider.webdav.WebdavFileObject.doGetType(WebdavFileObject.java:405)

at
org.apache.commons.vfs2.provider.AbstractFileObject.getType(AbstractFileObject.java:1497)

... 56 more

What am I doing wrong? And what does "Attached:false" means?