hi,
  I am getting the following error while running the command line example
Slide.java

[LOCALHOST] /slide/ $ ls
files                     actions                   users
[LOCALHOST] /slide/ $ cd files
[LOCALHOST] /slide/files/ $ search
Performing a search on the server side
Inside the generate method of the Search Method
[LOCALHOST] /slide/files/ $ lock test
Locking '/slide/files/test': Fatal Error:
org.apache.commons.httpclient.State
Command input: lock test
java.lang.ClassCastException: org.apache.commons.httpclient.State
        at
org.apache.webdav.lib.WebdavResource.generateIfHeader(WebdavResource.java:60
6)
        at
org.apache.webdav.lib.WebdavResource.lockMethod(WebdavResource.java:3236)
        at
org.apache.webdav.lib.WebdavResource.lockMethod(WebdavResource.java:3214)
        at org.apache.webdav.cmd.Slide.processCommands(Slide.java:1343)
        at org.apache.webdav.cmd.Slide$1.run(Slide.java:218)
        at java.lang.Thread.run(Unknown Source)
Please, email to [EMAIL PROTECTED]


It looks like the problem is that HttpClient.getState() return an object of
the class State but it is being cast to
WebdavState in the WebdavResource class. Does any body have a fix for this.
    thanks.
    rajkumar

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Sunday, August 26, 2001 11:28 AM
To: [EMAIL PROTECTED]
Subject: cvs commit:
jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods
PropPatchMethod.java


dirkv       01/08/26 11:27:35

  Modified:    src/webdav/client/src/org/apache/webdav/lib/methods
                        PropPatchMethod.java
  Log:
  little xml optimization when using DAV: namespace

  Revision  Changes    Path
  1.19      +10 -4
jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/PropPatchM
ethod.java

  Index: PropPatchMethod.java
  ===================================================================
  RCS file:
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/
PropPatchMethod.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- PropPatchMethod.java      2001/06/20 01:33:10     1.18
  +++ PropPatchMethod.java      2001/08/26 18:27:35     1.19
  @@ -1,7 +1,7 @@
   /*
  - * $Header:
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/
PropPatchMethod.java,v 1.18 2001/06/20 01:33:10 remm Exp $
  - * $Revision: 1.18 $
  - * $Date: 2001/06/20 01:33:10 $
  + * $Header:
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/
PropPatchMethod.java,v 1.19 2001/08/26 18:27:35 dirkv Exp $
  + * $Revision: 1.19 $
  + * $Date: 2001/08/26 18:27:35 $
    *
    * ====================================================================
    *
  @@ -82,6 +82,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Remy Maucherat</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>B.C. Holmes</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Robert Owen</a>
  + * @author Dirk Verbeeck
    */
   public class PropPatchMethod
       extends XMLResponseMethodBase {
  @@ -246,8 +247,13 @@
               printer.writeElement("D", null, "prop", XMLPrinter.OPENING);
               while (toSetList.hasMoreElements()) {
                   Property current = (Property) toSetList.nextElement();
  -                printer.writeProperty(current.namespace,
current.namespaceInfo,
  +                if ("DAV:".equals(current.namespaceInfo)) {
  +                    printer.writeProperty("D", null, current.name,
current.value);
  +                }
  +                else {
  +                    printer.writeProperty(current.namespace,
current.namespaceInfo,
                                         current.name, current.value);
  +                }
               }
               printer.writeElement("D", null, "prop", XMLPrinter.CLOSING);





Reply via email to