chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "mark streit (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CMIS-530) update cmis:name property of a previously uploaded file "appears" to fail with CmisObjectNotFoundException" but actually does the rename
Date Wed, 09 May 2012 16:51:50 GMT
mark streit created CMIS-530:
--------------------------------

             Summary: update cmis:name property of a previously uploaded file "appears" to
fail with CmisObjectNotFoundException" but actually does the rename
                 Key: CMIS-530
                 URL: https://issues.apache.org/jira/browse/CMIS-530
             Project: Chemistry
          Issue Type: Bug
          Components: opencmis-client
    Affects Versions: OpenCMIS 0.8.0
         Environment: Win 7 Enterprise/32-bit Tomcat 7.0.22/ JDK 1.6.0_29 using the project
WAR - chemistry-opencmis-server-fileshare  created from source: chemistry-opencmis-server-fileshare-0.8.0-SNAPSHOT.war
            Reporter: mark streit


when attempting to follow the approach that is shown in the example code called GettingStarted.java

        Document doc2 = (Document) session.getObject(id2);
        System.out.println("renaming " + doc2.getName() + " to test3.txt");
        properties = new HashMap<String, Object>();
        properties.put(PropertyIds.NAME, "test3.txt");
        id2 = doc2.updateProperties(properties);
        System.out.println("renamed to " + doc2.getName());

The call to updateProperties(), with a correctly populated Map containing the new name throws
back a CmisObjectNotFoundException which I've traced back to the refresh() method of AbstractCmisObject.java.
 

    public void refresh() {
        writeLock();
        try {
            String objectId = getObjectId();

            OperationContext oc = getCreationContext();

            // get the latest data from the repository
            ObjectData objectData = getSession()
                    .getBinding().getObjectService().getObject(getRepositoryId(), objectId,
oc.getFilterString(), oc.isIncludeAllowableActions(), oc.getIncludeRelationships(), oc.getRenditionFilterString(),
oc.isIncludePolicies(), oc.isIncludeAcls(), null);

            // reset this object
            initialize(getSession(), getObjectType(), objectData, this.creationContext);
        } finally {
            writeUnlock();
        }
    }


When you start inspecting the values of each of the objects in the chained call above where
it tries to get back an ObjectData instance... things look OK UNTIL you hit the method: getObjectService()



getBinding() IS OK returing this:
org.apache.chemistry.opencmis.client.bindings.impl.CmisBindingImpl@4c689e  

objectId = L0NoZW1Eb2NzXzExL1Rlc3RGaWxlOS5wZGY=    // this is also OK

but this call, getObjectService() reports that "the method getObjectService() is undefined
for the type AbstractCmisObject"

The objectData instance is never created, and it skips to the finally block,  so I AM ASSUMING,
this might be the root cause.  I don't know enough about Chemistry, but what is more odd:

1) the file on the file system DOES get renamed correctly
2) the execution path getting there however involves this 

org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException: Object not found!






--
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

        

Mime
View raw message