06-18-2015 08:48 AM
14:17:06,418 ERROR [freemarker.runtime] [http-apr-8080-exec-18] Error executing FreeMarker template
FreeMarker template error:
The following has evaluated to null or missing:
==> jsonUtils.encodeJSONString(x) [in template "org/alfresco/repository/site/site-admin-sites.get.json.ftl" at line 4, column 15]
Tip: If the failing expression is known to be legally null/missing, either specify a default value with myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthessis: (myOptionVar.foo)!myDefault, (myOptionVar.foo)??
The failing instruction (FTL stack trace):
———-
==> ${manager.lastName} auto-escaped [in template "org/alfresco/repository/site/site-admin-sites.get.json.ftl" in macro "siteJSON" at line 20, column 51]
@siteJSON item=item [in template "org/alfresco/repository/site/site-admin-sites.get.json.ftl" at line 30, column 11]
#nested item [in template "org/alfresco/repository/generic-paged-results.lib.ftl" in macro "standardRestfulPagedResults" at line 83, column 21]
@gen.standardRestfulPagedResults data… [in template "org/alfresco/repository/site/site-admin-sites.get.json.ftl" at line 29, column 4]
———-
Java stack trace (for programmers):
———-
freemarker.core.InvalidReferenceException: [… Exception message was already printed; see it above …]
at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:98)
at freemarker.core.EvalUtil.coerceModelToString(EvalUtil.java:382)
at freemarker.core.Expression.evalAndCoerceToString(Expression.java:115)
at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
at freemarker.core.Environment.visit(Environment.java:265)
at freemarker.core.MixedContent.accept(MixedContent.java:93)
at freemarker.core.Environment.visitByHiddingParent(Environment.java:286)
at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:193)
at freemarker.core.Environment.visitIteratorBlock(Environment.java:509)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:103)
at freemarker.core.Environment.visit(Environment.java:265)
at freemarker.core.MixedContent.accept(MixedContent.java:93)
at freemarker.core.Environment.visit(Environment.java:265)
at freemarker.core.EscapeBlock.accept(EscapeBlock.java:85)
at freemarker.core.Environment.visit(Environment.java:265)
at freemarker.core.Macro$Context.runMacro(Macro.java:209)
at freemarker.core.Environment.visit(Environment.java:694)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:116)
at freemarker.core.Environment.visit(Environment.java:265)
at freemarker.core.Environment.visit(Environment.java:487)
at freemarker.core.BodyInstruction.accept(BodyInstruction.java:93)
at freemarker.core.Environment.visit(Environment.java:265)
at freemarker.core.MixedContent.accept(MixedContent.java:93)
at freemarker.core.Environment.visitByHiddingParent(Environment.java:286)
at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:193)
at freemarker.core.Environment.visitIteratorBlock(Environment.java:509)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:103)
at freemarker.core.Environment.visit(Environment.java:265)
at freemarker.core.MixedContent.accept(MixedContent.java:93)
at freemarker.core.Environment.visit(Environment.java:265)
at freemarker.core.Macro$Context.runMacro(Macro.java:209)
at freemarker.core.Environment.visit(Environment.java:694)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:116)
at freemarker.core.Environment.visit(Environment.java:265)
at freemarker.core.MixedContent.accept(MixedContent.java:93)
at freemarker.core.Environment.visit(Environment.java:265)
at freemarker.core.Environment.process(Environment.java:243)
at org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:217)
at org.springframework.extensions.webscripts.AbstractWebScript.renderTemplate(AbstractWebScript.java:955)
at org.springframework.extensions.webscripts.DeclarativeWebScript.renderFormatTemplate(DeclarativeWebScript.java:267)
at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:147)
at org.alfresco.repo.web.scripts.RepositoryContainer$3.execute(RepositoryContainer.java:463)
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:454)
at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:532)
at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:600)
at org.alfresco.repo.web.scripts.RepositoryContainer.executeScriptInternal(RepositoryContainer.java:380)
at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:261)
at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:378)
at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)
at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:132)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:61)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2441)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2430)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
06-22-2015 02:51 AM
<#import "../generic-paged-results.lib.ftl" as gen/>
<#macro siteJSON item>
<#escape x as jsonUtils.encodeJSONString(x)>
"url" : "${url.serviceContext + "/api/sites/" + item.siteInfo.shortName}",
"sitePreset" : "${item.siteInfo.sitePreset}",
"shortName" : "${item.siteInfo.shortName}",
"title" : "${item.siteInfo.title}",
"description" : "${item.siteInfo.description}",
"createdDate" : "${xmldate(item.siteInfo.createdDate)}",
"lastModifiedDate" : "${xmldate(item.siteInfo.lastModifiedDate)}",
"visibility" : "${item.siteInfo.visibility}",
"userIsSiteManager" : "${item.currentUserSiteManager?c}",
"siteManagers" : [
<#list item.members as manager>
{
"entry" : {
"userName" : "${manager.userName}",
"firstName" : "${manager.firstName}",
"lastName" : "${manager.lastName}"
}
}<#if manager_has_next>,</#if>
</#list>
]
</#escape>
</#macro>
{
<@gen.standardRestfulPagedResults data=data ; item>
<@siteJSON item=item />
</@gen.standardRestfulPagedResults>
}
06-22-2015 03:52 AM
06-22-2015 08:15 AM
10-12-2015 06:22 AM
04-28-2016 09:43 AM
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.