AnsweredAssumed Answered

Beginner problem with customization

Question asked by miguel.martins on Nov 30, 2009
Latest reply on Dec 3, 2009 by miguel.martins
I am following a tutorial for Alfresco, called Alfresco_3_Enterprise_Content_Management_Implementation

At a certain point, testing the aspects, it tells me to change the file
custom-model-context.xml.sample
into custom-model-context.xml

Then it tells me to edit the file customModel.xml
with

<aspects>
   <!– Definition of new Content Aspect: Customer Details –>
   <aspect name="custom:CustomerDetails">
      <title>Customer Details</title>
      <properties>
          <property name="custom:CustomerName">
             <title>Customer Name</title>
                          <type>d:text</type>
                          <protected>false</protected>
                          <mandatory>false</mandatory>
                          <multiple>false</multiple>
                      </property>
                      <property name="custom:CustomerContactName">
                          <title>Customer Contact Name</title>
                          <type>d:text</type>
                      </property>
                      <property name="custom:CustomerContactPhone">
                          <title>Customer Contact Phone</title>
                          <type>d:text</type>
                      </property>
                      <property name="custom:CustomerProjectID">
                          <title>Customer Project ID</title>
                          <type>d:int</type>
                      </property>
                      <property name="custom:NewCustomer">
                          <title>New Customer</title>
                          <type>d:boolean</type>
                          <default>true</default>
                      </property>
                 </properties>
             </aspect>
        </aspects>

right before the line </model>
last, it indicates to edit the file
web-client-config-custom.xml
with

<!– Lists the custom aspect in business rules Action wizard –>
<config evaluator="string-compare" condition="Action Wizards">
   <aspects>
      <aspect name="custom:CustomerDetails"/>
   </aspects>
</config>
   <!– Displays the properties in view details page –>
   <config evaluator="aspect-name" condition="custom:CustomerDetails">
      <property-sheet>
         <separator name="sepCust1" display-label="Customer Details"
component-generator="HeaderSeparatorGenerator" />
         <show-property name="custom:CustomerName"/>
         <show-property name="custom:CustomerContactName"/>
         <show-property name="custom:CustomerContactPhone"/>
         <show-property name="custom:CustomerProjectID"/>
         <show-property name="custom:NewCustomer"/>
      </property-sheet>
   </config>



This is the error that the file alfresco.log indicates

rg.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: 10300001 Could not import bootstrap model alfresco/extension/customModel.xml
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: 10300001 Could not import bootstrap model alfresco/extension/customModel.xml
   at org.alfresco.repo.dictionary.DictionaryBootstrap.onDictionaryInit(DictionaryBootstrap.java:151)
   at org.alfresco.repo.dictionary.DictionaryBootstrap.bootstrap(DictionaryBootstrap.java:108)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:616)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1242)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1208)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1172)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:427)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:291)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
   at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:189)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
   at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:69)
   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.deployDescriptor(HostConfig.java:627)
   at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
   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:57)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:616)
   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: 10300000 Failed to parse model
   at org.alfresco.repo.dictionary.M2Model.createModel(M2Model.java:99)
   at org.alfresco.repo.dictionary.DictionaryBootstrap.onDictionaryInit(DictionaryBootstrap.java:146)
   … 43 more
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}aspects" start tag (line 35, col 10)
   at org.jibx.runtime.impl.UnmarshallingContext.parsePastCurrentEndTag(UnmarshallingContext.java:800)
   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:2773)
   at org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(UnmarshallingContext.java:2916)
   at org.alfresco.repo.dictionary.M2Model.createModel(M2Model.java:94)
   … 44 more

If I pass on to edit the custom model context xml file, it allows alfresco to run (it crashes otherwise) and inside I can see the aspect named customerdetail. Any attempt to apply it to a file however, show a system error.

Outcomes