cancel
Showing results for 
Search instead for 
Did you mean: 

Ayuda: Constraints List

nalvarez_colesc
Star Contributor
Star Contributor

Muy buenos días, amigos. Disculpen la molestia,  En esta oportunidad estoy queriendo comenzar a trabajar con propiedades tipo lista en mis modelos de datos, y la verdad que no vengo muy bien... Me encuentro con varios errores. Les dejo en primer lugar la definición de a constante y le propiedad en cuestión que la va a consumir.

<?xml version="1.0" encoding="UTF-8"?>
<model name="soin:model" xmlns="http://www.alfresco.org/model/dictionary/1.0">
<!-- ABM DE METADATOS -->

<description>Modelo para SOIN</description>
<author>DSIC</author>
<version>1.0</version>

<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>

<namespaces>
<namespace uri="soin.model" prefix="soin" />
</namespaces>


<!-- CONSTANTE DE EJEMPLO PARA ARMAR LISTA -->

<constraints>
<constraint name="soin:estadoList" type="LIST">
<parameter name="allowedValues">
<list>
<value>Activo</value>
<value>Modificado</value>
<value>Deprecado</value>
<value>Inactivo</value>
</list>
</constraint>
</constraints>

......

<!-- EJEMPLO DE PROPIEDAD EN LISTA -->
<property name="soin:estado">
 <type>d:text</type>
<multiple>true</multiple>
<constraints>
<constraint ref="soin:estadoList"</>
</constraints>
</property>

Ahora les dejo el log....

2018-11-07 09:34:06,176 WARN [context.support.XmlWebApplicationContext] [localhost-startStop-1] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'extension.dictionaryBootstrap' defined in file [/opt/alfresco-community/tomcat/shared/classes/alfresco/extension/model-context.xml]: Invocation of init method failed; nested exception is org.alfresco.service.cmr.dictionary.DictionaryException: 10070001 Could not import bootstrap model 'alfresco/extension/soinModel.xml'
2018-11-07 09:34:06,198 ERROR [web.context.ContextLoader] [localhost-startStop-1] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'extension.dictionaryBootstrap' defined in file [/opt/alfresco-community/tomcat/shared/classes/alfresco/extension/model-context.xml]: Invocation of init method failed; nested exception is org.alfresco.service.cmr.dictionary.DictionaryException: 10070001 Could not import bootstrap model 'alfresco/extension/soinModel.xml'
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1514)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:636)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:938)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:70)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5118)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5634)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:679)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1966)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: 10070001 Could not import bootstrap model 'alfresco/extension/soinModel.xml'
at org.alfresco.repo.dictionary.DictionaryBootstrap.onDictionaryInit(DictionaryBootstrap.java:180)
at org.alfresco.repo.dictionary.DictionaryBootstrap.bootstrap(DictionaryBootstrap.java:125)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1640)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1581)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1511)
... 26 more
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: 10070000 Failed to parse model
at org.alfresco.repo.dictionary.M2Model.createModel(M2Model.java:113)
at org.alfresco.repo.dictionary.M2Model.createModel(M2Model.java:99)
at org.alfresco.repo.dictionary.DictionaryBootstrap.onDictionaryInit(DictionaryBootstrap.java:168)
... 34 more
Caused by: org.jibx.runtime.JiBXException: Error parsing document (line 105, col 41)
at org.jibx.runtime.impl.XMLPullReaderFactory$XMLPullReader.next(XMLPullReaderFactory.java:295)
at org.jibx.runtime.impl.UnmarshallingContext.isAt(UnmarshallingContext.java:529)
at org.alfresco.repo.dictionary.JiBX_defaultM2Constraint_access.isPresent()
at org.alfresco.repo.dictionary.JiBX_defaultMungeAdapter.JiBX_default_test_1_18()
at org.alfresco.repo.dictionary.JiBX_defaultMungeAdapter.JiBX_default_unmarshal_1_30()
at org.alfresco.repo.dictionary.JiBX_defaultM2Property_access.unmarshal()
at org.alfresco.repo.dictionary.JiBX_defaultMungeAdapter.JiBX_default_unmarshal_1_17()
at org.alfresco.repo.dictionary.JiBX_defaultMungeAdapter.JiBX_default_unmarshal_1_22()
at org.alfresco.repo.dictionary.JiBX_defaultMungeAdapter.JiBX_default_unmarshal_1_27()
at org.alfresco.repo.dictionary.JiBX_defaultM2Type_access.unmarshal()
at org.alfresco.repo.dictionary.JiBX_defaultMungeAdapter.JiBX_default_unmarshal_1_7()
at org.alfresco.repo.dictionary.JiBX_defaultMungeAdapter.JiBX_default_unmarshal_1_9()
at org.alfresco.repo.dictionary.JiBX_defaultM2Model_access.unmarshal()
at org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(UnmarshallingContext.java:2757)
at org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(UnmarshallingContext.java:2900)
at org.alfresco.repo.dictionary.M2Model.createModel(M2Model.java:108)
... 36 more
Caused by: org.xmlpull.v1.XmlPullParserException: start tag unexpected character < (position: TEXT seen ...<constraints>\r\n\t\t\t\t\t\t<constraint ref="soin:estadoList"<... @105:41)
at org.xmlpull.mxp1.MXParser.parseStartTag(MXParser.java:1803)
at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1259)
at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093)
at org.jibx.runtime.impl.XMLPullReaderFactory$XMLPullReader.next(XMLPullReaderFactory.java:291)
... 51 more
nov 07, 2018 9:34:06 AM org.apache.catalina.core.StandardContext listenerStart
GRAVE: Excepción enviando evento inicializado de contexto a instancia de escuchador de clase org.alfresco.web.app.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'extension.dictionaryBootstrap' defined in file [/opt/alfresco-community/tomcat/shared/classes/alfresco/extension/model-context.xml]: Invocation of init method failed; nested exception is org.alfresco.service.cmr.dictionary.DictionaryException: 10070001 Could not import bootstrap model 'alfresco/extension/soinModel.xml'
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1514)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:636)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:938)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:70)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5118)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5634)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:679)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1966)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: 10070001 Could not import bootstrap model 'alfresco/extension/soinModel.xml'
at org.alfresco.repo.dictionary.DictionaryBootstrap.onDictionaryInit(DictionaryBootstrap.java:180)
at org.alfresco.repo.dictionary.DictionaryBootstrap.bootstrap(DictionaryBootstrap.java:125)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1640)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1581)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1511)
... 26 more
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: 10070000 Failed to parse model
at org.alfresco.repo.dictionary.M2Model.createModel(M2Model.java:113)
at org.alfresco.repo.dictionary.M2Model.createModel(M2Model.java:99)
at org.alfresco.repo.dictionary.DictionaryBootstrap.onDictionaryInit(DictionaryBootstrap.java:168)
... 34 more
Caused by: org.jibx.runtime.JiBXException: Error parsing document (line 105, col 41)
at org.jibx.runtime.impl.XMLPullReaderFactory$XMLPullReader.next(XMLPullReaderFactory.java:295)
at org.jibx.runtime.impl.UnmarshallingContext.isAt(UnmarshallingContext.java:529)
at org.alfresco.repo.dictionary.JiBX_defaultM2Constraint_access.isPresent()
at org.alfresco.repo.dictionary.JiBX_defaultMungeAdapter.JiBX_default_test_1_18()
at org.alfresco.repo.dictionary.JiBX_defaultMungeAdapter.JiBX_default_unmarshal_1_30()
at org.alfresco.repo.dictionary.JiBX_defaultM2Property_access.unmarshal()
at org.alfresco.repo.dictionary.JiBX_defaultMungeAdapter.JiBX_default_unmarshal_1_17()
at org.alfresco.repo.dictionary.JiBX_defaultMungeAdapter.JiBX_default_unmarshal_1_22()
at org.alfresco.repo.dictionary.JiBX_defaultMungeAdapter.JiBX_default_unmarshal_1_27()
at org.alfresco.repo.dictionary.JiBX_defaultM2Type_access.unmarshal()
at org.alfresco.repo.dictionary.JiBX_defaultMungeAdapter.JiBX_default_unmarshal_1_7()
at org.alfresco.repo.dictionary.JiBX_defaultMungeAdapter.JiBX_default_unmarshal_1_9()
at org.alfresco.repo.dictionary.JiBX_defaultM2Model_access.unmarshal()
at org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(UnmarshallingContext.java:2757)
at org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(UnmarshallingContext.java:2900)
at org.alfresco.repo.dictionary.M2Model.createModel(M2Model.java:108)
... 36 more
Caused by: org.xmlpull.v1.XmlPullParserException: start tag unexpected character < (position: TEXT seen ...<constraints>\r\n\t\t\t\t\t\t<constraint ref="soin:estadoList"<... @105:41)
at org.xmlpull.mxp1.MXParser.parseStartTag(MXParser.java:1803)
at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1259)
at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093)
at org.jibx.runtime.impl.XMLPullReaderFactory$XMLPullReader.next(XMLPullReaderFactory.java:291)
... 51 more

Aclaraciones:

1) El modelo funciona ok.

2) Si comento las definiciones va todo ok.

3) Para realizar esto, me base en un libro que tengo "Alfresco One 5.x Developer's Guide - Second Edition" y en la documentacion oficial de Alfresco

Desde ya muchas gracias, saludos.

Nelson

2 REPLIES 2

angelborroy
Community Manager Community Manager
Community Manager

Cambia

<constraint ref="soin:estadoList"</>

por

<constraint ref="soin:estadoList"/>
Hyland Developer Evangelist

nalvarez_colesc
Star Contributor
Star Contributor

Angel.... sos muy crack !!!!!!!!!!!!!!! quedo funcionando..... Muchas gracias y perdón por la molestia.

Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.