AnsweredAssumed Answered

Error in xml file. Trying to import a content type

Question asked by luizfrazao on Mar 28, 2008
Latest reply on Apr 2, 2008 by rivarola
Hi.!

I'm trying to import a example content type, but a got this error


17:28:29,402 ERROR [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/alfresco]] Exception sending context initialized event to listener instance of class org.alfresco.web.app.ContextListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'extension.dictionaryBootstrap' defined in file [D:\Material de Trabalho - Luiz\alfresco_tomcat\tomcat\shared\classes\alfresco\extension\someco-model-context.xml]: Invocation of init method failed; nested exception is org.alfresco.service.cmr.dictionary.DictionaryException: Could not import bootstrap model alfresco/extension/scModel.xml
Caused by:
org.alfresco.service.cmr.dictionary.DictionaryException: Could not import bootstrap model alfresco/extension/scModel.xml
   at org.alfresco.repo.dictionary.DictionaryBootstrap.bootstrap(DictionaryBootstrap.java:111)
   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:1160)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1122)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1085)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:429)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:250)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:247)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:161)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:273)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:346)
   at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
   at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3764)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4216)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
   at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825)
   at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714)
   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
   at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
   at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
   at org.apache.catalina.core.StandardService.start(StandardService.java:448)
   at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
   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:295)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
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.bootstrap(DictionaryBootstrap.java:106)
   … 42 more
Caused by: org.jibx.runtime.JiBXException: Expected end tag, found start tag "{http://www.alfresco.org/model/dictionary/1.0}aspect" (line 40, col 14)
   at org.jibx.runtime.impl.UnmarshallingContext.toEnd(UnmarshallingContext.java:548)
   at org.jibx.runtime.impl.UnmarshallingContext.parsePastEndTag(UnmarshallingContext.java:805)
   at org.alfresco.repo.dictionary.JiBX_root_projects_repository_source_java_org_alfresco_repo_dictionary_m2bindingM2Type_access.unmarshal()
   at org.alfresco.repo.dictionary.JiBX_MungeAdapter.JiBX_root_projects_repository_source_java_org_alfresco_repo_dictionary_m2binding_unmarshal_1_4()
   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


My scModel is described below.


<?xml version="1.0" encoding="UTF-8"?>

   <!–Definition of new Model–>
   <model name="sc:somecomodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
      <!–Optional metadata about the model–>
      <description>Someco Model</description>
      <author>Optaros</author>
      <version>1.0</version>
      <!–Imports are required to allow references to definitions in other models–>
      <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>

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

      <types>
         <!–Enterprisewide generic document type–>
         <type name="sc:doc">
            <title>Someco Document</title>
            <parent>cm:content</parent>
            <associations>
               <association name="sc:relatedDocuments">
                  <title>Related Documents</title>
                  <source>
                     <mandatory>false</mandatory>
                     <many>true</many>
                  </source>
                  <target>
                     <class>sc:doc</class>   
                     <mandatory>false</mandatory>
                     <many>true</many>
                  </target>
               </association>
            </associations>
            <mandatoryaspects>
               <aspect>cm:generalclassifiable</aspect>
            </mandatoryaspects>
         </type>
         <type name="sc:whitepaper">
            <title>Someco Whitepaper</title>
            <parent>sc:doc</parent>
         </type>
      </types>

      <aspects>
         <aspect name="sc:webable">
            <title>Someco Webable</title>
            <properties>
               <property name="sc:published">
                  <type>d:date</type>
               </property>
               <property name="sc:isActive">
                  <type>d:boolean</type>
                  <default>false</default>
               </property>
            </properties>
         </aspect>
         <aspect name="sc:productRelated">
            <title>Someco Product Metadata</title>
            <properties>
               <property name="sc:product">
                  <type>d:text</type>
                  <mandatory>true</mandatory>
               </property>
               <property name="sc:version">
                  <type>d:text</type>
                  <mandatory>true</mandatory>
               </property>
            </properties>
         </aspect>
      </aspects>
   </model>


can anybody helps me?
What can I do?

Outcomes