This may or may not be your problem, but in order to perform many
operations with locks you must first read the current lock information.
There is a requirement in Webdav that all relevant lock tokens be listed
in the request header or the operation fails.  Using a new
WebdavResource, or using a WebdavResource that was created with the
NOACTION parameter will not have the required lock tokens in the request
header and will fail.  Either read the object first with a default
action OR use the lockDiscoveryPropertyFindMethod (I think) to update
the list of lock tokens before performing your operation.

-----Original Message-----
From: Chris Greene [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 07, 2005 10:18 AM
To: slide-user@jakarta.apache.org
Subject: Ver 2.1 problem with Unlock

Folks,

I appreciate any help you might offer, thanks.

The second request for UNLOCK fails in ver 2.1 but not in ver 2.0.

(All of the wd methods are wrapper methods using Slide webdavresource
methods.
We're using the Xythos webdav server.)

Here are the log entries...
com.idc.cms.WebdavClient     - UNLOCK FAILURE: OK (200) code: 200      
checkin_process.jsp     - Finish Task - Unlock Failed!!           
checkin_process.jsp     - Finish Task - Lock state isLocked: true 


if (wd.isLocked(xythosFolder + fileName)) {
        tempIsFileLocked = true;

        if (wd.unLock(xythosFolder + fileName)) {
                logger.debug("Put file - Unlock Succeeded");
        } else {
                logger.debug("Put file - Unlock Failed!!");
        }

} else {
        tempIsFileLocked = false;
}

// Retrieve the file contents and upload to Xythos //
-----------------------------------------------
InputStream inStream = fi.getInputStream();

if (!(wd.putFileFromInputStream( xythosFolder + fileName, inStream ))) {
        isError = true;
        throw new RuntimeException("Unable to store " + xythosFolder +
fileName + " in Xythos." ); } else {
        if (tempIsFileLocked == true) {
                tempIsFileLocked = false;
                if (!(wd.setLock(xythosFolder + fileName,
cnfg.getXythosUsername(),
CmsConst.DEFAULT_LOCK_DURATION))) {
                        logger.warn("Lock failed on: " + xythosFolder +
fileName);
                }
        }
}

//Later in the code - HERE IS WHERE THE LOCK FAILS if
(wd.unLock(xythosFolder + fileName)) {
        logger.debug("Finish Task - Unlock Succeeded"); } else {
        logger.debug("Finish Task - Unlock Failed!!"); }
logger.debug("Finish Task - Lock state isLocked: " +
wd.isLocked(xythosFolder + fileName));

Here are the log entries...
com.idc.cms.WebdavClient     - UNLOCK FAILURE: OK (200) code: 200      
checkin_process.jsp     - Finish Task - Unlock Failed!!           
checkin_process.jsp     - Finish Task - Lock state isLocked: true

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to