You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chemistry.apache.org by "mark streit (JIRA)" <ji...@apache.org> on 2012/05/09 18:59:49 UTC

[jira] [Updated] (CMIS-530) update cmis:name property of a previously uploaded file "appears" to fail with CmisObjectNotFoundException" but actually does the rename

     [ https://issues.apache.org/jira/browse/CMIS-530?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

mark streit updated CMIS-530:
-----------------------------

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

{code} 
        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());

{code} 

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.  

{code} 
    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();
        }
    }

{code} 

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

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

objectId = L0NoZW1Eb2NzXzExL1Rlc3RGaWxlOS5wZGY=    // this is also OK
{code} 

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 

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

{code} 




  was:
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!






    
> 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
>              Labels: AbstractCmisObject, CmisObjectNotFoundException, getObjectService(), refresh()
>
> when attempting to follow the approach that is shown in the example code called GettingStarted.java
> {code} 
>         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());
> {code} 
> 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.  
> {code} 
>     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();
>         }
>     }
> {code} 
> 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() 
> {code} 
> getBinding() IS OK returing this:
> org.apache.chemistry.opencmis.client.bindings.impl.CmisBindingImpl@4c689e  
> objectId = L0NoZW1Eb2NzXzExL1Rlc3RGaWxlOS5wZGY=    // this is also OK
> {code} 
> 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 
> {code} 
> org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException: Object not found!
> {code} 

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