cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco 3.0 Custom Extension Fails on Bootstrap

ghernando
Champ in-the-making
Champ in-the-making
Hello,

I had some files based on Jeff Potts custom extension that work for me on a Ubuntu 7.1 install of Alfresco 2.2 with MySQL 5.
Those same files fail for me when I install them and try to start an identical environment with Alfresco 3.0 installed.
I'm not sure why or how to debug this.  Has something changed in Alfresco 3.0?

Does this mean that the xml of the Model file may have syntax errors.  I don't see any, and I tried stripping the model file down to a barebones one, and the problem still happens.  (And the files work OK on Alfresco 2.2)

Thanks for your help!

INFO: Deploying web application archive alfresco.war
Nov 5, 2008 8:37:44 PM org.apache.catalina.core.StandardContext addApplicationListener
INFO: The listener "org.apache.myfaces.webapp.StartupServletContextListener" is already configured for this context. The duplicate definition has been ignored.
20:38:31,691  INFO  [config.xml.XMLConfigService$PropertyConfigurer] Loading properties file from class path resource [alfresco/file-servers.properties]
20:38:37,093  ERROR [web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'extension.dictionaryBootstrap' defined in file [/opt/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/extension/xp-model-context.xml]: Invocation of init method failed; nested exception is org.alfresco.service.cmr.dictionary.DictionaryException: Could not import bootstrap model alfresco/extension/xpModel.xml
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: Could not import bootstrap model alfresco/extension/xpModel.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)
2 REPLIES 2

libman
Champ in-the-making
Champ in-the-making
I have followed the tutorials and I have no problem. If you copied the configuration files from the PDF, try with the sourcearchive. Also post your XML files and the full log.

syed_imtiaz
Champ in-the-making
Champ in-the-making
I have encountered the same problem.

Environment in use Alfresco-Labs-3d-dev-Full-Setup.exe under Windows XP with Derby database.

xml model files are residing in C:\Alfresco\tomcat\shared\classes\alfresco\extension

Following code has been used for model context.


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

<!DOCTYPE beans PUBLIC "-//SPRING/DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

<beans>
    <!– Registration of new models –>
    <bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/extension/bbmcModel.xml</value>
            </list>
        </property>
    </bean>
</beans>

Following code has been used for model:


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

<!– Definition of new Model –>

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

    <!– Optional metadata about the model –>
    <description>BBMC Model</description>
    <author>Imtiaz</author>
    <version>1.0</version>

    <!– Imports are required to allow references to definitions in other models –>
    <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 –>
    <namespaces>
        <namespace uri="http://www.bbmc.com.qa/model/content/1.0" prefix="bbmc" />
    </namespaces>

    <types>
        <!– Enterprisewide generic document type –>
        <type name="bbmc:doc">
            <title>BBMC Document</title>
            <parent>cm:content</parent>
            <associations>
                <association name="bbmc:relatedDocuments">
                <title>Related Documents</title>
                    <source>
                        <mandatory>false</mandatory>
                        <many>true</many>
                    </source>
                    <target>
                        <class>bbmc:doc</class>
                        <mandatory>false</mandatory>
                        <many>true</many>
                    </target>
                </association>
            </associations>

            <mandatory-aspects>
                <aspect>cm:generalclassifiable</aspect>
            </mandatory-aspects>
        </type>

        <type name="bbmc:Drawings">
            <title>BBMC Engineering Drawings</title>
            <parent>bbmc:doc</parent>
        </type>
    </types>

    <aspects>
        <aspect name="bbmc:webable">
            <title>BBMC Webable</title>
            <properties>
                <property name="bbmc:published">
                    <type>d:date</type>
                </property>
                <property name="bbmc:isActive">
                    <type>d:boolean</type>
                    <default>false</default>
                </property>
            </properties>
        </aspect>

        <aspect name="bbmc:drawingRelated">
            <title>BBMC Drawings related Metadata</title>
            <properties>
                <property name="bbmc:projecttitle">
                    <type>d:text</type>
                    <mandatory>true</mandatory>
                </property>
                <property name="bbmc:drawingtitle">
                    <type>d:text</type>
                    <mandatory>true</mandatory>
                </property>
                <property name="bbmc:drawingnumber">
                    <type>d:text</type>
                    <mandatory>true</mandatory>
                </property>
                <property name="bbmc:sheetnumber">
                    <type>d:text</type>
                    <mandatory>false</mandatory>
                </property>
                <property name="bbmc:continuationsheetnumber">
                    <type>d:text</type>
                    <mandatory>false</mandatory>
                </property>
                <property name="bbmc:revision">
                    <type>d:text</type>
                    <mandatory>false</mandatory>
                </property>
                <property name="bbmc:copies">
                    <list>
                        <value>"Both Available"</value>
                        <value>"Softcopy Available"</value>
                        <value>"Hardcopy Available"</value>
                    </list>
                </property>
                <property name="bbmc:lastdrawingstatus">
                    <type>d:text</type>
                    <mandatory>false</mandatory>
                </property>
                <property name="bbmc:lastdrawingstatusdate">
                    <type>d:date</type>
                    <mandatory>false</mandatory>
                </property>
            </properties>
        </aspect>
    </aspects>

</model>


Error at bootstrap as follows:

14:31:37,650 INFO  [org.alfresco.config.xml.XMLConfigService$PropertyConfigurer] Loading properties file from class path resource [alfresco/file-servers.properties]
14:31:38,668 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'extension.dictionaryBootstrap' defined in file [C:\Alfresco\tomcat\shared\classes\alfresco\extension\bbmc-model-context.xml]: Invocation of init method failed; nested exception is org.alfresco.service.cmr.dictionary.DictionaryException: Could not import bootstrap model alfresco/extension/bbmcModel.xml
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: Could not import bootstrap model alfresco/extension/bbmcModel.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.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.initDictionary(DictionaryBootstrap.java:142)
   … 42 more
Caused by: org.jibx.runtime.JiBXException: Expected "{http://www.alfresco.org/model/dictionary/1.0}type" start tag, found "{http://www.alfresco.org/model/dictionary/1.0}list" start tag (line 98, col 27)
   at org.jibx.runtime.impl.UnmarshallingContext.throwStartTagNameError(UnmarshallingContext.java:288)
   at org.jibx.runtime.impl.UnmarshallingContext.parsePastStartTag(UnmarshallingContext.java:767)


   … 43 more
14:31:38,684 ERROR [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/alfresco]] Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'extension.dictionaryBootstrap' defined in file [C:\Alfresco\tomcat\shared\classes\alfresco\extension\bbmc-model-context.xml]: Invocation of init method failed; nested exception is org.alfresco.service.cmr.dictionary.DictionaryException: Could not import bootstrap model alfresco/extension/bbmcModel.xml
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: Could not import bootstrap model alfresco/extension/bbmcModel.xml
   at org.alfresco.repo.dictionary.DictionaryBootstrap.initDictionary(DictionaryBootstrap.java:147)
   at org.alfresco.repo.dictionary.DictionaryBootstrap.bootstrap(DictionaryBootstrap.java:108)


Any help is most welcome.

Thanks in advance.