Custom Aspect - Fehler bei Start

cancel
Showing results for 
Search instead for 
Did you mean: 
alwa
Member II

Custom Aspect - Fehler bei Start

Hallo Zusammen,

bin ganz neu im Umfeld Alfresco und hab auch schon mein ersten Problemchen.

Ich habe mir nach einer Anleitung aus einem Buch eigene Aspecte angelegt.
Dabei habe ich im Verzeichnis "<TOMCAT_HOME>/shared/classes/alfresco/extension" die folgenden Dateien angepasst

    customModel.xml
    custom-model-context.xml
    web-client-config-custom.xml
custom-model-context.xml
<?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/customModel.xml</value>
            </list>
        </property>
    </bean>
         
</beans>

customModel.xml

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

<!– Custom Model –>

<!– Note: This model is pre-configured to load at startup of the Repository.  So, all custom –>
<!–       types and aspects added here will automatically be registered –>

<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>
     
   <aspects>
      <!– Definition of a new Content Aspect Customer Details –>
      <aspect name="custom:CustomerDetails">
         <title>Customer Deatils</title>
         <properties>
            <property name="custom:CustomerName">
               <title>Customer Name</title>
               <type>:text</type>
            </property>
            <property name="custom:CustomerContractName">
               <title>Customer Contract Name</title>
               <type>:text</type>
            </property>
            <property name="custom:CustomerContractPhone">
               <title>Customer Contract Phone</title>
               <type>:text</type>
            </property>
            <property name="custom:CustomerProjectID">
               <title>Customer Project ID</title>
               <type>:int</type>
            </property>
            <property name="custom:NewCustomer">
               <title>New Customer</title>
               <type>:boolean</type>
            </property>
         </properties>
      </aspect>
   </aspects>
   
</model>


web-client-config-custom.xml

<alfresco-config>
      <!– Lists the custom aspect in business ruels Action wizard –>
   <config evaluator="string-compare" condition="Action Wizards">
      <aspects>
         <aspect name="custom:CustomerDetails"/>
      </aspects>
   </config>
   
   <!– Displays the properties in the 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:CustomerContractName"/>
         <show-property name="custom:CustomerContractPhone"/>
         <show-property name="custom:CustomerProjectID"/>
         <show-property name="custom:NewCustomer"/>
      </property-sheet>
   </config>
   
</alfresco-config>


Nun bekomme ich jedoch beim Start folgende Fehlermeldung:

11:20:44,984 INFO  [org.alfresco.config.JndiPropertiesFactoryBean] Loading properties file from class path resource [alfresco/repository.properties]
11:20:44,984 INFO  [org.alfresco.config.JndiPropertiesFactoryBean] Loading properties file from class path resource [alfresco/domain/transaction.properties]
11:20:44,984 INFO  [org.alfresco.config.JndiPropertiesFactoryBean] Loading properties file from URL [file:/C:/Alfresco/tomcat/shared/classes/alfresco-global.properties]
11:20:45,125 INFO  [org.alfresco.config.JndiPropertyPlaceholderConfigurer] Loading properties file from class path resource [alfresco/alfresco-shared.properties]
11:21:02,093 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\custom-model-context.xml]: Invocation of init method failed; nested exception is org.alfresco.service.cmr.dictionary.DictionaryException: 10130001 Could not import bootstrap model alfresco/extension/customModel.xml
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: 10130001 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: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: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: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: 10130000 Failed to compile model custom:customModel
   at org.alfresco.repo.dictionary.CompiledModel.<init>(CompiledModel.java:112)
   at org.alfresco.repo.dictionary.M2Model.compile(M2Model.java:134)
   at org.alfresco.repo.dictionary.DictionaryDAOImpl.putModel(DictionaryDAOImpl.java:274)
   at org.alfresco.repo.dictionary.DictionaryBootstrap.onDictionaryInit(DictionaryBootstrap.java:147)
   … 43 more
Caused by: org.alfresco.service.namespace.NamespaceException: Namespace prefix  is not mapped to a namespace URI
   at org.alfresco.service.namespace.QName.createQName(QName.java:105)
   at org.alfresco.service.namespace.QName.createQName(QName.java:127)
   at org.alfresco.repo.dictionary.M2PropertyDefinition.<init>(M2PropertyDefinition.java:69)
   at org.alfresco.repo.dictionary.M2ClassDefinition.<init>(M2ClassDefinition.java:99)
   at org.alfresco.repo.dictionary.M2AspectDefinition.<init>(M2AspectDefinition.java:48)
   at org.alfresco.repo.dictionary.CompiledModel.constructDefinitions(CompiledModel.java:165)
   at org.alfresco.repo.dictionary.CompiledModel.<init>(CompiledModel.java:94)
   … 46 more
11:21:11,906 INFO  [org.alfresco.web.site.FrameworkHelper] Successfully Initialized Web Framework
11:21:25,296 INFO  [org.alfresco.web.site.FrameworkHelper] Successfully Initialized Web Framework

Ich habe die Änderungen in den XML Dateien schon ein paar mal durchgelesen und verglichen. Jedoh finde ich den Fehler einfach nicht.
Nun hoffe ich mal, dass jemand hier mir eventuell Helfen kann.

Vielen Dank im Vorraus
Grüße
1 Reply
alwa
Member II

Re: Custom Aspect - Fehler bei Start

Hab den Fehler nun doch selbst gefunden Smiley Happy
Manchmal sieht man vor lauter Bäumen den Wald nicht.

Hab in der Datei customModle.xml beim Typ ":text" statt "d:text" geschrieben, das war alles.
Nach der Korrektur lief alles wie es sollte Smiley Happy

grüße