cancel
Showing results for 
Search instead for 
Did you mean: 

Redering of custom model broken in 4.2.c

armino
Champ in-the-making
Champ in-the-making
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 Smiley Sad
What now?

-Armin
6 REPLIES 6

scouil
Star Contributor
Star Contributor
Hello,

We'll need a bit more details there.

What do you mean "As soon as a constraint is involved"?
Is the error triggered at server startup? Or when you try to view a form containing this property (workflow form? document details? on share or explorer?)
Does this only applies to the "LIST" constraint or any constraint ("REGEX", "LENGTH", etc.)?

During the 2 days it cost you, what workaround did you try?
Did you try overriding the view to remove the buggy field from the view? or just trying to render it with a different form component?
Have you tried dumbing your model down to see if it works (remove the "title" and "default" parameters from your property for example)

Regards,

armino
Champ in-the-making
Champ in-the-making
Hi Scoiul,
Error at startup? No, model(s) evaluate without error
What triggers the error:
a) Open a document from the documentLibrary of type cm:content in share
b) Open Change Type dialogue
c) Select a custom type with a LIST constraint
d) Receive a pop up with "Invalid Operation" (exception chain see my fist post)

After fiddling around with my own models and stripping them down, i tried the example model from the alfresco documentation (cut and paste from my fist post to reproduce). Even this simple model triggers the error in 4.2.c and - needless to say - works in 4.2.b.

Best wishes,
Armin

duracipatie
Champ in-the-making
Champ in-the-making
Same here. When share UI try to render a preview of  a custom model where we define some properties with constraints (in my case allowedValue), Alfresco throw this exception :

<code lang="java">
    org.springframework.extensions.webscripts.WebScriptException: 00290001 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)
</code>


I think also that this is a regression and all custom model with constaraints will not work with 4.2.c version.
A snippet of my custom model  :

               <constraint name="form:docTypeList" type="LIST">
      <parameter name="allowedValues">
        <list>
         <value>Formule de change 1</value>
         <value>Formule de change 2</value>
         <value>Formule de change 3</value>
         <value>Formule de change 4</value>
         <value>Formule de change 5</value>
         <value>Formule de change 6</value>
        </list>
       </parameter>
       <parameter name="caseSensitive">
         <value>false</value>
      </parameter>
      </constraint>


Let me know plz if any one fix the problem.

scouil
Star Contributor
Star Contributor
Hello,

I've the same problem that I described in more details here: https://forums.alfresco.com/forum/developer-discussions/content-modeling/42c-regression-custom-const...
It actually fails when the form is automatically generated by alfresco.
In my case at least, for the form views that I have redefined myself (http://wiki.alfresco.com/wiki/Forms) I don't have the bug anymore.

So it seems like a regression to me but you might be able to work around it.
Please give it a try and come back to share your results.

Has anyone opened a Jira about this yet?

armino
Champ in-the-making
Champ in-the-making

cmorgia
Champ in-the-making
Champ in-the-making
Hi all,
it's confirmed on 4.2.c. I have a task model that inherits the field "wf:reviewOutcome" and fails FormUIGet in the same way.
Looking back into the stacktrace, the only way to fix is to check for nullity before testing for sorting (line 1956).

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.