AnsweredAssumed Answered

Error adding aspect: Could not import bootstrap model alfres

Question asked by chicco0386 on May 20, 2009
Latest reply on May 21, 2009 by mikef
Hi
I've this customModel.xml where I've added an aspect and a type:

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

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

   <imports>
        <!– Import Alfresco Dictionary Definitions –>
      <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"/>
   </imports>

   <!– Introduction of new namespaces defined by this model –>
   <!– NOTE: The following namespace custom.model should be changed to reflect your own namespace –>
   <namespaces>
      <namespace uri="custom.model" prefix="custom"/>
   </namespaces>
  
   <!–Inserisco uno nuovo tipo–>
   <types>
      <type name="custom:protocollazione">
         <title>Protocollo</title>
         <parent>cm:content</parent>
      </type>  
   </types>
  
   <aspects>
         <aspect name="custom:numProtocollazione">
            <title>Numero protocollo</title>
            <properties>
               <property name="custom:numero">
                  <type>d:int</type>
               </property>
            </properties>
         </aspect>
   </aspects>  
</model>

so my web-client-custom-model.xml is like this:

<alfresco-config>

   <!–Inserisco il tipo protocollazione nell'actionWizard in modo da visualizzarlo–>
   <config evaluator="string-compare" condition="Action Wizards">
      <aspects>
         <aspect name="custom:numProtocollazione"/>
      </aspects>
      <subtypes>
         <type name="custom:protocollazione"/>
      </subtypes>
   </config>
  
   <!–Per visualizzarlo quando creo un nuovo contenuto–>
   <config evaluator="string-compare" condition="Content Wizards">
      <content-types>
         <type name="custom:protocollazione"/>
      </content-types>
   </config>
  
   <config evaluator="node-type" condition="custom:protocollazione">
   <property-sheet>
      <show-property name="mimetype" display-label-id="content_type" component-generator="MimeTypeSelectorGenerator" />
      <show-property name="size" display-label-id="size" converter="org.alfresco.faces.ByteSizeConverter" show-in-edit-mode="false" />
   </property-sheet>
   </config>
  
   <config evaluator="node-type" condition="custom:numProtocollazione">
   <property-sheet>
      <show-property name="custom:numero"/>
   </property-sheet>
   </config>
</alfresco-config

The log error is this:
17:41:57,624 INFO  [org.alfresco.web.scripts.DeclarativeRegistry] Registered 67 Web Scripts (+0 failed), 71 URLs
17:41:57,626 INFO  [org.alfresco.web.scripts.AbstractRuntimeContainer] Initialised Presentation Web Script Container (in 652.82324ms)
17:42:58,660 INFO  [org.alfresco.web.scripts.DeclarativeRegistry] Registered 101 Web Scripts (+0 failed), 105 URLs
17:42:58,661 INFO  [org.alfresco.web.scripts.AbstractRuntimeContainer] Initialised WebFramework Web Script Container (in 61015.035ms)
17:42:58,742 INFO  [org.alfresco.web.site.FrameworkHelper] Successfully Initialized Web Framework
17:43:20,112 INFO  [org.alfresco.config.xml.XMLConfigService$PropertyConfigurer] Loading properties file from class path resource [alfresco/file-servers.properties]
17:43:21,630 DEBUG [org.alfresco.repo.jscript] preRegister called. Server=com.sun.jmx.mbeanserver.JmxMBeanServer@1b2979e, name=log4j:logger=org.alfresco.repo.jscript
17:43:21,838 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'extension.dictionaryBootstrap' defined in file [/opt/Alfresco/tomcat/shared/classes/alfresco/extension/custom-model-context.xml]: Invocation of init method failed; nested exception is org.alfresco.service.cmr.dictionary.DictionaryException: Could not import bootstrap model alfresco/extension/customModel.xml
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: Could not import bootstrap model alfresco/extension/customModel.xml
   at org.alfresco.repo.dictionary.DictionaryBootstrap.initDictionary(DictionaryBootstrap.java:147)
   at org.alfresco.repo.dictionary.DictionaryBootstrap.bootstrap(DictionaryBootstrap.java:108)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1240)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1205)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1171)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:287)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
   at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
   at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:830)
   at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:719)
   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
   at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
   at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
   at org.apache.catalina.core.StandardService.start(StandardService.java:516)
   at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: Failed to parse model
   at org.alfresco.repo.dictionary.M2Model.createModel(M2Model.java:99)
   at org.alfresco.repo.dictionary.DictionaryBootstrap.initDictionary(DictionaryBootstrap.java:142)
   … 42 more
Caused by: org.jibx.runtime.JiBXException: Error parsing document (line 43, col 19)
   at org.jibx.runtime.impl.UnmarshallingContext.isAt(UnmarshallingContext.java:616)
   at org.jibx.runtime.impl.UnmarshallingContext.parseIfStartTag(UnmarshallingContext.java:784)
   at org.jibx.runtime.impl.UnmarshallingContext.parseElementBoolean(UnmarshallingContext.java:1915)
   at org.alfresco.repo.dictionary.M2Property.JiBX_root_projects_repository_source_java_org_alfresco_repo_dictionary_m2binding_unmarshal_1_0(M2Property.java)
   at org.alfresco.repo.dictionary.JiBX_root_projects_repository_source_java_org_alfresco_repo_dictionary_m2bindingM2Property_access.unmarshal()
   at org.alfresco.repo.dictionary.JiBX_MungeAdapter.JiBX_root_projects_repository_source_java_org_alfresco_repo_dictionary_m2binding_unmarshal_1_10()
   at org.alfresco.repo.dictionary.M2Class.JiBX_root_projects_repository_source_java_org_alfresco_repo_dictionary_m2binding_unmarshal_1_0(M2Class.java)
   at org.alfresco.repo.dictionary.M2Aspect.JiBX_root_projects_repository_source_java_org_alfresco_repo_dictionary_m2binding_unmarshal_2_0(M2Aspect.java)
   at org.alfresco.repo.dictionary.JiBX_root_projects_repository_source_java_org_alfresco_repo_dictionary_m2bindingM2Aspect_access.unmarshal()
   at org.alfresco.repo.dictionary.JiBX_MungeAdapter.JiBX_root_projects_repository_source_java_org_alfresco_repo_dictionary_m2binding_unmarshal_1_5()
   at org.alfresco.repo.dictionary.M2Model.JiBX_root_projects_repository_source_java_org_alfresco_repo_dictionary_m2binding_unmarshal_1_0(M2Model.java)
   at org.alfresco.repo.dictionary.JiBX_root_projects_repository_source_java_org_alfresco_repo_dictionary_m2bindingM2Model_access.unmarshal()
   at org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(UnmarshallingContext.java:2515)
   at org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(UnmarshallingContext.java:2675)
   at org.alfresco.repo.dictionary.M2Model.createModel(M2Model.java:94)
   … 43 more
17:43:26,725 INFO  [org.alfresco.web.site.FrameworkHelper] Successfully Initialized Web Framework

The strange thing is that Alfresco works fine when I only have the type definition, but when I uncomment the lines where I specified the aspect Alfresco give me the error…. :shock:  :?

PLEASE HELP ME
THANKS

Outcomes