我正在从linux/IntelliJ/Ant迁移一个基于Al新鲜an 3.2r13的应用程序到Windows/Eclipse。
稍后的目标是将Maven添加到Eclipse项目中,但现在,我只希望它能够工作。
目前,我面临以下问题:
我将contentTypesModel.xml添加到项目中,下面是第一行:
<?xml version="1.0" encoding="UTF-8"?><!-- Optional meta-data about the model -->
<description>Example custom Model</description>
<author></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"/>
<import uri="http://www.alfresco.org/grimoire/model/ma0189cstr/1.0" prefix="ma0189cstr"/>
<import uri="http://www.alfresco.org/grimoire/model/ma43110cstr/1.0" prefix="ma43110cstr" />
<import uri="http://www.alfresco.org/grimoire/model/baremesSys/1.0"
prefix="baremesSys"/>
<import uri="http://www.alfresco.org/grimoire/model/baremes/1.0"
prefix="baremes"/>
<import
uri="http://www.alfresco.org/grimoire/model/workflow/baremes/perimetres/1.0"
prefix="perimetres"/>
</imports>
<!-- Introduction of new namespaces defined by this model -->
<!-- NOTE: The following namespace my.new.model should be changed to reflect
your own namespace -->
<namespaces>
<namespace uri="http://www.alfresco.org/grimoire/model/contenttypes/1.0"
prefix="GPCT"/>
</namespaces>在尝试运行Tomcat时,我得到了以下错误跟踪:
> 23 déc. 2015 16:28:44,047 ERROR [web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'extension.dictionaryBootstrap' defined in file [D:\TomcatGrimoire\webapps\GrimoireMk0\WEB-INF\classes\alfresco\extension\gp-models-context.xml]: Invocation of init method failed; nested exception is org.alfresco.service.cmr.dictionary.DictionaryException: 11230001 Could not import bootstrap model alfresco/extension/contentTypesModel.xml
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: 11230001 Could not import bootstrap model alfresco/extension/contentTypesModel.xml
at org.alfresco.repo.dictionary.DictionaryBootstrap.onDictionaryInit(DictionaryBootstrap.java:150)
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:606)
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:4205)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4704)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
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:606)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: 11230000 Failed to compile model GPCT:gpcontenttypeswfmodel
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:273)
at org.alfresco.repo.dictionary.DictionaryBootstrap.onDictionaryInit(DictionaryBootstrap.java:146)
... 34 more
Caused by: org.alfresco.service.namespace.NamespaceException: URI http://www.alfresco.org/grimoire/model/ma0189cstr/1.0 cannot be imported as it is not defined (with prefix ma0189cstr
at org.alfresco.repo.dictionary.CompiledModel.createLocalPrefixResolver(CompiledModel.java:209)
at org.alfresco.repo.dictionary.CompiledModel.constructDefinitions(CompiledModel.java:134)
at org.alfresco.repo.dictionary.CompiledModel.<init>(CompiledModel.java:94)
... 37 more文件wfMA0189Constraints.xml包含以下定义:
<!-- Optional meta-data about the model -->
<description>MA0189 Constraints Workflow Model</description>
<author>FSE</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.alfresco.org/grimoire/model/ma0189cstr/1.0" prefix="ma0189cstr"/>
</namespaces>就我所理解的错误而言,tomcat服务器不承认文件的内容。问题是,经过检查,tomcat构建确实包含了该文件。
所以我被这个错误困住了。欢迎您的光临。
提前谢谢,节日快乐。
发布于 2015-12-23 22:00:11
应该在扩展路径中部署一个spring上下文文件。文件的名称通常以"-context.xml“结尾。查找包含内容模型文件名称的上下文文件:您应该看到带有parent="dictionaryModelBootstrap“的bean的定义。
如果找不到这个上下文文件,请尝试在源代码中找到它,看看它是如何被intellij/ant打包的
详情请访问:http://docs.alfresco.com/5.1/tasks/dev-extensions-content-models-tutorials-deploy-model.html
发布于 2015-12-28 10:11:42
此问题可能是由加载内容模型的顺序引起的。这可能解释了IntelliJ和Eclipse之间的区别。
如果您想要确定您可以使用“依赖”作为bean初始化中的属性的顺序。
如果模型位于不同的模块中,则还可以使用模块依赖项。参见示例:http://docs.alfresco.com/4.2/concepts/dev-extensions-modules-module-properties.html
发布于 2015-12-28 13:47:39
似乎您在上下文文件中缺少了"wfMA0189Constraints.xml"模型文件的条目。这就是Alfresco无法提取该模型的原因,因此它将前缀显示为未识别的前缀。
根据您的日志,我看到您正在使用"gp-models-context.xml“作为上下文文件。你能在那里看到这个模型文件(wfMA0189Constraints.xml)的条目吗?
https://stackoverflow.com/questions/34439259
复制相似问题