AnsweredAssumed Answered

Cannot determine child association for node type

Question asked by amit_wmw@yahoo.com on Apr 7, 2009
Latest reply on Apr 7, 2009 by amit_wmw@yahoo.com
Hello,

I am using alfresco2.1 and I have created a custom content type as below.

<model name="sc:somecomodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">



<!– Optional meta-data about the model –>
<description>Someco Model</description>
<author>Optaros</author>
<version>1.0</version>

<imports>
     
     <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />
<!– Import Alfresco Content Domain Model Definitions –>
<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
<import uri="http://www.alfresco.org/model/system/1.0" prefix="sys"/>
</imports>


<!– Introduction of new namespaces defined by this model –>
<namespaces>
<namespace uri="http://www.alfresco.org/model/content1/1.0" prefix="sc"/>

</namespaces>


<types>
<type name="sc:scobject">
         <title>Object</title>
         <parent>sys:base</parent>
      
       
      </type>
     
      <type name="sc:folder">
         <title>Folder</title>
         <parent>sc:scobject</parent>
         <archive>true</archive>
         <associations>
            <child-association name="sc:contains">
               <source>
                  <mandatory>false</mandatory>
                  <many>true</many>
               </source>
               <target>
                  <class>sys:base</class>
                  <mandatory>false</mandatory>
                  <many>true</many>
               </target>
               <duplicate>false</duplicate>
            </child-association>
         </associations>
      </type>

     
   <!– Enterprise-wide generic document type –>
   <type name="sc:doc">
      
      <title>Someco Document</title>
      <properties>
            <property name="sc:name">
               <type>d:text</type>
            </property>
         </properties>   
   </type>
</types>


</model>

But while executing my code I am getting below error message.

error while creating nodes javax.jcr.RepositoryException: Cannot determine child association for node type '{http://www.alfresco.org/model/content1/1.0}doc within parent workspace://SpacesStore/88ad434d-2037-11de-914e-f311c9e69274: Cannot determine child association for node type '{http://www.alfresco.org/model/content1/1.0}doc within parent workspace://SpacesStore/88ad434d-2037-11de-914e-f311c9e69274
javax.jcr.RepositoryException: Cannot determine child association for node type '{http://www.alfresco.org/model/content1/1.0}doc within parent workspace://SpacesStore/88ad434d-2037-11de-914e-f311c9e69274: Cannot determine child association for node type '{http://www.alfresco.org/model/content1/1.0}doc within parent workspace://SpacesStore/88ad434d-2037-11de-914e-f311c9e69274
   at org.alfresco.jcr.util.JCRProxyFactory$SessionContextInvocationHandler.invoke(JCRProxyFactory.java:175)
   at $Proxy86.addNode(Unknown Source)
   at org.hcl.grcmip.workflow.document.jcr.impl.JCRTemplateImpl.save(JCRTemplateImpl.java:64)
   at org.hcl.grcmip.workflow.document.vo.impl.Main.main(Main.java:30)
Caused by: org.alfresco.error.AlfrescoRuntimeException: Cannot determine child association for node type '{http://www.alfresco.org/model/content1/1.0}doc within parent workspace://SpacesStore/88ad434d-2037-11de-914e-f311c9e69274
   at org.alfresco.jcr.item.NodeImpl.getNodeTypeChildAssocDefForParent(NodeImpl.java:258)
   at org.alfresco.jcr.item.NodeImpl.addNode(NodeImpl.java:189)
   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)
   … 3 more
org.alfresco.error.AlfrescoRuntimeException: Cannot determine child association for node type '{http://www.alfresco.org/model/content1/1.0}doc within parent workspace://SpacesStore/88ad434d-2037-11de-914e-f311c9e69274
   at org.alfresco.jcr.item.NodeImpl.getNodeTypeChildAssocDefForParent(NodeImpl.java:258)
   at org.alfresco.jcr.item.NodeImpl.addNode(NodeImpl.java:189)
   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 $Proxy86.addNode(Unknown Source)
   at org.hcl.grcmip.workflow.document.jcr.impl.JCRTemplateImpl.save(JCRTemplateImpl.java:64)
   at org.hcl.grcmip.workflow.document.vo.impl.Main.main(Main.java:30)

Kindly suggest what can be done to resolve this error.

Thanks
Amit.

Outcomes