AnsweredAssumed Answered

Nullpointer exception when updating properties

Question asked by glaenen on Feb 7, 2011
Latest reply on Feb 8, 2011 by fmui
Hello, I'm trying to use alfresco opencmis extension to update properties in custom types and custom aspects.
And I'm getting nullpointer exceptions in 2 specific cases:

- When trying to update a property contained  by an aspect that was never set to that document before.
  So adding a property to the hashmap with an empty string when creating a file ( properties.put("my:prop", "");  )
  enables me to update my:prop without a problem, otherwise I get a nullpointer exception.

- When trying to update a property of a custom aspect applied to a document of a custom type.
  Updating properties contained by the type itself is no problem.
  Also when I apply this aspect to the default cmis:domunent there is no problem.
  Combining both the custom type and custom aspect and I get a nullpointer exception.

Either of the 2 cases above gives me:

Exception in thread "main" java.lang.NullPointerException
   at org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl.convertProperties(Unknown Source)
   at org.apache.chemistry.opencmis.client.runtime.AbstractCmisObject.updateProperties(AbstractCmisObject.java:314)
   at org.alfresco.cmis.client.impl.AlfrescoDocumentImpl.updateProperties(Unknown Source)
   at org.apache.chemistry.opencmis.client.runtime.AbstractCmisObject.updateProperties(AbstractCmisObject.java:277)
   at be.cmc.qp.JavaCMIS2.pathAndUpdateProperty(JavaCMIS2.java:314)
   at be.cmc.qp.JavaCMIS2.main(JavaCMIS2.java:51)

Is anybody else having the same issues? Or knows what is going wrong?
Hopefully my explanation is clear enough.

Thanks,

Glenn

Outcomes