AnsweredAssumed Answered

Redering of custom model broken in 4.2.c

Question asked by armino on Jan 28, 2013
Latest reply on Jan 30, 2013 by armino
The default install 4.2.c (on ubuntu 12.10) cannot render a custom type with constraint. E.g. this model taken from the alfresco documentation:

<?xml version="1.0" encoding="UTF-8"?>
<model name="kb:contentmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
    <description>Knowledge Base Content Model</description>
    <author>alfresco_professional</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="http://www.example.org/knowledgebase" prefix="kb"/>
    </namespaces>


    <constraints>
        <constraint name="kb:attachmenttype_constraint" type="LIST">
            <parameter name="allowedValues">
                <list>
                    <value>Patch</value>
                    <value>Sample</value>
                    <value>Documentation</value>
                </list>
            </parameter>
        </constraint>
        <constraint name="kb:status_constraint" type="LIST">
            <parameter name="allowedValues">
                <list>
                    <value>Draft</value>
                    <value>Pending Approval</value>
                    <value>Current</value>
                    <value>Archived</value>
                </list>
            </parameter>
        </constraint>
        <constraint name="kb:articletype_constraint" type="LIST">
            <parameter name="allowedValues">
                <list>
                    <value>Any</value>
                    <value>Article</value>
                    <value>FAQ</value>
                    <value>White Paper</value>
                </list>
            </parameter>
        </constraint>
    </constraints>

    <types>
        <type name="kb:attachment">
            <title>Attachment</title>
            <parent>cm:content</parent>
            <properties>
                <property name="kb:attachmenttype">
                    <title>Attachment Type</title>
                    <type>d:text</type>
                    <default>Sample</default>
                    <constraints>
                        <constraint ref="kb:attachmenttype_constraint" />
                    </constraints>
                </property>
            </properties>
        </type>
    </types>
    </model>
[code]

As soon as a constraint is involved it throws this error and share reports "internal error":

[code]
2013-01-28 16:52:30,894  ERROR [extensions.webscripts.AbstractRuntime] [http-apr-8080-exec-2] Exception from executeScript - redirecting to status template error: 00280000 Wrapped Exception (with status template): null
org.springframework.extensions.webscripts.WebScriptException: 00280000 Wrapped Exception (with status template): null
        at org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:1067)
        at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:171)
        at org.springframework.extensions.webscripts.PresentationContainer.executeScript(PresentationContainer.java:70)
        at org.springframework.extensions.webscripts.LocalWebScriptRuntimeContainer.executeScript(LocalWebScriptRuntimeContainer.java:240)
        at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:377)
        at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)
        at org.springframework.extensions.webscripts.servlet.mvc.WebScriptView.renderMergedOutputModel(WebScriptView.java:104)
        at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
        at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1047)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:817)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
        at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
        at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
        at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:412)
        at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
        at org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:195)
        at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:159)
        at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141)
        at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90)
        at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:417)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
        at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1813)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.NullPointerException
        at org.alfresco.web.scripts.forms.FormUIGet.processFieldConstraintControl(FormUIGet.java:1956)
        at org.alfresco.web.scripts.forms.FormUIGet.generateConstraintModel(FormUIGet.java:1816)
        at org.alfresco.web.scripts.forms.FormUIGet.processFieldConstraints(FormUIGet.java:1701)
        at org.alfresco.web.scripts.forms.FormUIGet.generateFieldModel(FormUIGet.java:1315)
        at org.alfresco.web.scripts.forms.FormUIGet.generateDefaultSetModelUsingServerFields(FormUIGet.java:1255)
        at org.alfresco.web.scripts.forms.FormUIGet.processServerFields(FormUIGet.java:1117)
        at org.alfresco.web.scripts.forms.FormUIGet.processFields(FormUIGet.java:1058)
        at org.alfresco.web.scripts.forms.FormUIGet.generateFormUIModel(FormUIGet.java:666)
        at org.alfresco.web.scripts.forms.FormUIGet.generateFormModel(FormUIGet.java:609)
        at org.alfresco.web.scripts.forms.FormUIGet.generateModel(FormUIGet.java:265)
        at org.alfresco.web.scripts.forms.FormUIGet.executeImpl(FormUIGet.java:220)
        at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:64)
        … 40 more


So far this issue cost me two full days :(
What now?

-Armin

Outcomes