cancel
Showing results for 
Search instead for 
Did you mean: 

Site Manager - There was an error loading the data

agu84
Champ in-the-making
Champ in-the-making
Hi,

i have a problem with displaying data under Site Manager. I'm getting "There was an error loading the data" and nothing more. In server logs there are messages like this:


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)


any idea what could be wrong?

Best Regards,
5 REPLIES 5

borisstankov
Champ in-the-making
Champ in-the-making
Hi there,

When the error masseges stared to show up:
- Have you did something that caused them - any actions on the file system where is the alfresco installation?
- Any other actions like upgrade procedures or changing any varialble, custom code enabled?

Basically this is how this "site-admin-sites.get.json.ftl" file should look like:


<#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>
}


And that's it, which could means that you are missing something from the file or the whole file, I can't explain why else you will see such an error.
Here is the GIThub link for the file:
https://github.com/Alfresco/community-edition/blob/master/projects/remote-api/config/alfresco/templa...

I do not know in which .jar file is located this .ftl file, but if you find it, check what's in it.

Cheers.

agu84
Champ in-the-making
Champ in-the-making
Hi,

thanks for your response.

<blockcode>Have you did something that caused them - any actions on the file system where is the alfresco installation? </blockcode>

no i didn't

<blockcode>Any other actions like upgrade procedures or changing any varialble, custom code enabled</blockcode>

i've modified alfresco-global.properties file to set ldap auth.

Yes, i noticed that the file is missing and meantime i also found it on github, but don't know where to put it in the alfresco catalog structure 😕
I have alfresco 5.0.c version and there is no such structure like config/alfresco/templates/webscripts/org/alfresco/repository/site/
I newbie in alfresco, could you please guide me and tell where to put this missing files?

Best Regards

borisstankov
Champ in-the-making
Champ in-the-making
well, the file is not missing. It's in one of the .jar files and it loads itself when you restart the alfresco service.

I do not know in which .jar file is it, I tried to find some info about the file, but without success. So maybe someone else is more familiar with it or with your error message.

sharifu
Confirmed Champ
Confirmed Champ
i get this same issue on 5.0.d. i done `grep -ri site-admin-sites.get.json.ftl *` under tomcat which returns

Binary file webapps/alfresco/WEB-INF/lib/alfresco-remote-api-5.0.d.jar matches



I extracted this jar and found no files with that name.


Can i place this file under tomcat/shared/classes? if so which directory?

jherioux
Champ in-the-making
Champ in-the-making
Hello,

I just ran into this same problem with 5.1 General Relase 201602. Like you, I had the exact same error and started looking for missing files.  However, just before deciding I wanted to try to dig down and recreate the missing file, I noticed the  ${manager.lastName} variable at the beginning of the error and decided to investigate.

I noticed you mentioned that you had configured LDAP authentication, which I had also done.  I was able to add the users fine, but my installation broke after I started adding users to sites.  What I eventually found out is that there are no files missing that need to be replaced.  The problem is that the ${manager.lastName} variable is coming up null due to the fact if a user was imported via LDAP and does not have BOTH a first and last name.  Had the user been created in Alfresco, not having a last name would have been fine, but this is not the case with LDAP.

Having an LDAP user with either a first or last name in Alfresco is okay until you add the user as the manager of a site (and possibly other sites, but haven't tested).

To fix the issue, simply add a last (or first) name to the user in LDAP, re-sync your LDAP Alfresco user profiles by restarting the alfresco service, and you should be all set to go!  Of course, do this for all users without a first and last name.  For example, I had a user called "Shipping" which I renamed to "Shipping ." in LDAP.  The user will never know the difference, and I can use Alfresco as intended.

Cheers Smiley Very Happy 
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.