AnsweredAssumed Answered

authorityContainer Properties in Alfresco 3c

Question asked by mark.smithson on Dec 8, 2008
Latest reply on Dec 16, 2008 by cow-cow
I have found a potential problem with 3c.

I created a new user and group in Alfresco and added the new user to the new group.

Given this webscript:

// locate person for username
var person = people.getPerson(url.extension);
model.groups = people.getContainerGroups(person);

and this template


<?xml version="1.0" encoding="UTF-8"?>
<groups>
      <#list 0..groups?size - 1 as x>
        <group>${groups[x].properties.name}</group>
      </#list>
</groups>


I get this error:

org.alfresco.service.cmr.repository.TemplateException - Error during processing of the template 'get(properties) failed on instance of org.alfresco.repo.template.TemplateNode'. Please contact your system administrator.

Stacktrace
java.lang.UnsupportedOperationException
         java.util.AbstractList.set(AbstractList.java:115)
         org.alfresco.repo.template.PropertyConverter.convertProperty(PropertyConverter.java:62)
         org.alfresco.repo.template.TemplateNode$TemplatePropertyConverter.convertProperty(TemplateNode.java:533)
         org.alfresco.repo.template.TemplateNode.getProperties(TemplateNode.java:221)
         sun.reflect.GeneratedMethodAccessor1101.invoke(Unknown Source)
         sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         java.lang.reflect.Method.invoke(Method.java:597)
         freemarker.ext.beans.BeansWrapper.invokeMethod(BeansWrapper.java:835)
         freemarker.ext.beans.BeanModel.invokeThroughDescriptor(BeanModel.java:276)
         freemarker.ext.beans.BeanModel.get(BeanModel.java:183)
         freemarker.core.Dot._getAsTemplateModel(Dot.java:76)
         freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
         freemarker.core.Dot._getAsTemplateModel(Dot.java:74)
         freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
         freemarker.core.Expression.getStringValue(Expression.java:93)
         freemarker.core.DollarVariable.accept(DollarVariable.java:76)
         freemarker.core.Environment.visit(Environment.java:208)
         freemarker.core.MixedContent.accept(MixedContent.java:92)
         freemarker.core.Environment.visit(Environment.java:208)
         freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:179)
         freemarker.core.Environment.visit(Environment.java:415)
         freemarker.core.IteratorBlock.accept(IteratorBlock.java:102)
         freemarker.core.Environment.visit(Environment.java:208)
         freemarker.core.MixedContent.accept(MixedContent.java:92)
         freemarker.core.Environment.visit(Environment.java:208)
         freemarker.core.Environment.process(Environment.java:188)
         freemarker.template.Template.process(Template.java:237)
         org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:201)
         org.alfresco.web.scripts.AbstractWebScript.renderTemplate(AbstractWebScript.java:504)
         org.alfresco.web.scripts.DeclarativeWebScript.renderFormatTemplate(DeclarativeWebScript.java:252)
         org.alfresco.web.scripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:145)
         org.alfresco.repo.web.scripts.RepositoryContainer$1.execute(RepositoryContainer.java:307)
         org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:294)
         org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:209)
         org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:318)
         org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:340)
         org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:262)
         org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:240)
         org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:139)
         org.alfresco.web.scripts.servlet.WebScriptServlet.service(WebScriptServlet.java:116)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
         org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
         org.alfresco.web.app.servlet.MTWebScriptAuthenticationFilter.doFilter(MTWebScriptAuthenticationFilter.java:102)
         org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
         org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
         org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
         org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
         org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
         org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
         org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
         org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
         org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
         org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
         org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
         org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
         org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
         java.lang.Thread.run(Thread.java:619)
      java.lang.reflect.InvocationTargetException
      sun.reflect.GeneratedMethodAccessor1101.invoke(Unknown Source)
      freemarker.template.TemplateModelException: get(properties) failed on instance of org.alfresco.repo.template.TemplateNode
      freemarker.ext.beans.BeanModel.get(BeanModel.java:223)
      org.alfresco.service.cmr.repository.TemplateException: Error during processing of the template 'get(properties) failed on instance of org.alfresco.repo.template.TemplateNode'. Please contact your system administrator.
      org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:205)

It seems to happen when accessing properties. If the user is only a member of the built in EMAIL_CONTRIBUTORS group this error does not occur.

This was not a problem on Labs 3b. Is this a bug, or have I missed something obvious?

Thanks

mark

Outcomes