AnsweredAssumed Answered

Adding Custom Property to nt:file node

Question asked by ajaiking on Jun 13, 2009
Latest reply on Mar 25, 2011 by alexer
Hi,

When we try to add a custom property to the nt:file node that i created using JCR API. I am getting a Null Pointer Exception.
Also i tried creating a nt:unstructured node, but it seems Alfresco doesn't have a implementation for it.

Kindly guide me how to create a custom property.

The exception that i get while creating a custom property is


Exception in thread "main" java.lang.NullPointerException
   at org.alfresco.jcr.item.PropertyImpl.checkSingleValued(PropertyImpl.java:638)
   at org.alfresco.jcr.item.PropertyImpl.setPropertyValue(PropertyImpl.java:517)
   at org.alfresco.jcr.item.NodeImpl.setProperty(NodeImpl.java:362)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.alfresco.jcr.util.JCRProxyFactory$SessionContextInvocationHandler.invoke(JCRProxyFactory.java:138)
   at $Proxy79.setProperty(Unknown Source)
   at org.alfresco.sample.AlfrescoActions.importFile(AlfrescoActions.java:180)
   at org.alfresco.sample.AlfrescoActions.main(AlfrescoActions.java:64)


I am in need of this info very urgently.

Thanks
Ajai G

Outcomes