【发布时间】:2016-01-20 04:54:02
【问题描述】:
部署并激活了 Alfresco (5.0.d CE) 的损坏的动态内容模型。
我所说的损坏是指内容模型无效,因为使用了不存在的错误类型。比如:
<property name="my:name">
<type>test</type>
</property>
“测试”显然无效 - 但模型中的错误在这里并不重要。
所以,这个内容模型被动态部署到了
Repository > Data Dictionary > Models
然后不幸的是通过 Alfresco API 调用激活(而不是通过 Share UI;因为 Share UI 通常在实际允许激活之前检查模型是否有效)。
这会导致 Alfresco 存储库不再启动,但失败并出现错误:
2016-01-19 18:17:11,780 ERROR [org.springframework.web.context.ContextLoader] [localhost-startStop-1] Context initialization failed
org.alfresco.service.namespace.NamespaceException: A namespace prefix is not registered for uri my.test.model
在启动时。
我现在的问题是如何在无法访问正在运行的 Alfresco 存储库实例的情况下再次停用这个损坏的模型,这不再能够访问 Data Dictionary > Models 文件夹。
我已经尝试在 /alfresco/tomcat/shared/classes/alfresco/extension 文件夹中部署具有相同模型名称的 customModel.xml 和 custom-model-context.xml 等,但这似乎并没有覆盖动态模型。 启动 Alfresco 时,我仍然收到上述错误。
有什么想法吗?谢谢!
仅供参考,这是我用来覆盖旧文件的更正后的虚拟 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="my:testModel" 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="my.test.model" prefix="my"/>
</namespaces>
</model>
【问题讨论】: