cancel
Showing results for 
Search instead for 
Did you mean: 

[RESOLVED] Failed to load custom model

bluearth
Champ in-the-making
Champ in-the-making
Hi all,

I have declared a custom model (shown below). it's a fairly straightforward one.
consisting of one document type with three simple properties; two date and a text.
I saved it in a file called: myModel.xml

And I also have registered the model by creating a context file called my-model-context.xml.
Both file resides under alfresco/extension package (under the tomcat shared folder).

Then when I rebooted tomcat,  I got the following exception ():


INFO: Initializing Spring root WebApplicationContext
03 Nov 09 12:00:25 org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.alfresco.web.app.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'extension.dictionaryBootstrap' defined in file [E:\alfresco\tomcat\shared\classes\alfresco\extension\my-model-context.xml]: Invocation of init method failed; nested exception is org.alfresco.service.cmr.dictionary.DictionaryException: 10030001 Could not import bootstrap model alfresco/extension/myModel.xml
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: 10030001 Could not import bootstrap model alfresco/extension/myModel.xml
   at org.alfresco.repo.dictionary.DictionaryBootstrap.onDictionaryInit(DictionaryBootstrap.java:151)
   at org.alfresco.repo.dictionary.DictionaryBootstrap.bootstrap(DictionaryBootstrap.java:108)
        [more stack trace follows]

Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: 10030000 Failed to parse model

Caused by: org.jibx.runtime.JiBXException: Expected "{http://www.alfresco.org/model/dictionary/1.0}model" end tag, found "{http://www.alfresco.org/model/dictionary/1.0}imports" start tag (line 20, col 13)

[more stack trace follows]

Can anyone tell my what is wrong with my model declaration?
Thanks before.


<model name="my:model" xmlns="http://www.alfresco.org/model/dictionary/1.0">
   <description>Experimental Model</description>
   <author>Barkah Yusuf</author>
   <version>0.1</version>
   <namespaces>
      <namespace uri="my.cms.model" prefix="my"/>
   </namespaces>
   <imports>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
      <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
   </imports>
   <types>  
      <type name="my:exp">
         <title>Exerimental content type</title>
         <parent>cm:content</parent>
         <properties>
            <property name="my:contentTimeLineStart">
               <type>d:datetime</type>
            </property>
            <property name="my:contentTimeLineEnd">
               <type>d:datetime</type>
            </property>
            <property name="my:contentOwner">
               <type>d:text</type>
            </property>
         </properties>
      </type>
   </types>
</model>
2 REPLIES 2

jayjayecl
Confirmed Champ
Confirmed Champ
you have to declare the "imports" before the "namespaces".

hope this helps

bluearth
Champ in-the-making
Champ in-the-making
you have to declare the "imports" before the "namespaces".

It works!  Thanks.