cancel
Showing results for 
Search instead for 
Did you mean: 

ERROR [freemarker.runtime] Expression memberFirstName

dranakan
Champ on-the-rise
Champ on-the-rise
Hello,

I have a message all 30 seconds in the logs. In think it's here because some users have no first name (user coming from AD). I have set a first and last name for the user (in AD), restart the Alfresco but the message is still here (in Alfresco the user has now the first and last name setted). What can I do ?
The dashlet "Site Activities" is not updated.

Alfresco 3.4D, RedHat.


08:10:41,991  ERROR [freemarker.runtime] Expression memberFirstName is undefined on line 2, column 18 in alfresco/templates/activities/org/alfresco/site/user-joined.atomentry.ftl.

Expression memberFirstName is undefined on line 2, column 18 in alfresco/templates/activities/org/alfresco/site/user-joined.atomentry.ftl.
The problematic instruction:
———-
==> ${memberFirstName?xml} [on line 2, column 16 in alfresco/templates/activities/org/alfresco/site/user-joined.atomentry.ftl]
———-

Java backtrace for programmers:
———-
freemarker.core.InvalidReferenceException: Expression memberFirstName is undefined on line 2, column 18 in alfresco/templates/activities/org/alfresco/site/user-joined.atomentry.ftl.
        at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
        at freemarker.core.Expression.getStringValue(Expression.java:118)
        at freemarker.core.Expression.getStringValue(Expression.java:93)
        at freemarker.core.StringBuiltins$StringBuiltIn._getAsTemplateModel(StringBuiltins.java:71)
        at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
        at freemarker.core.Expression.getStringValue(Expression.java:93)
        at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
        at freemarker.core.Environment.visit(Environment.java:210)
        at freemarker.core.MixedContent.accept(MixedContent.java:92)
        at freemarker.core.Environment.visit(Environment.java:210)
        at freemarker.core.Environment.visit(Environment.java:299)
        at freemarker.core.BlockAssignment.accept(BlockAssignment.java:83)
        at freemarker.core.Environment.visit(Environment.java:210)
        at freemarker.core.MixedContent.accept(MixedContent.java:92)
        at freemarker.core.Environment.visit(Environment.java:210)
        at freemarker.core.Environment.process(Environment.java:190)
        at freemarker.template.Template.process(Template.java:237)
        at org.alfresco.repo.activities.feed.FeedTaskProcessor.processFreemarker(FeedTaskProcessor.java:559)
        at org.alfresco.repo.activities.feed.FeedTaskProcessor.process(FeedTaskProcessor.java:300)
        at org.alfresco.repo.activities.feed.local.LocalFeedGridJob.execute(LocalFeedGridJob.java:53)
        at org.alfresco.repo.activities.feed.local.LocalFeedGenerator.generate(LocalFeedGenerator.java:96)
        at org.alfresco.repo.activities.feed.AbstractFeedGenerator.execute(AbstractFeedGenerator.java:137)
        at org.alfresco.repo.activities.feed.FeedGeneratorJob.execute(FeedGeneratorJob.java:50)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
08:10:41,992  INFO  [activities.feed.FeedTaskProcessor] >>> Generated 0 activity feed entries for 16 activity posts (in 70 msecs)
08:10:41,993  ERROR [feed.local.LocalFeedGridJob] freemarker.core.InvalidReferenceException: Expression memberFirstName is undefined on line 2, column 18 in alfresco/templates/activities/org/alfresco/site/user-joined.atomentry.ftl.
08:10:41,993  ERROR [activities.feed.AbstractFeedGenerator] Exception during generation of feeds
java.lang.Exception: Expression memberFirstName is undefined on line 2, column 18 in alfresco/templates/activities/org/alfresco/site/user-joined.atomentry.ftl.
        at org.alfresco.repo.activities.feed.local.LocalFeedGridJob.execute(LocalFeedGridJob.java:58)
        at org.alfresco.repo.activities.feed.local.LocalFeedGenerator.generate(LocalFeedGenerator.java:96)
        at org.alfresco.repo.activities.feed.AbstractFeedGenerator.execute(AbstractFeedGenerator.java:137)
        at org.alfresco.repo.activities.feed.FeedGeneratorJob.execute(FeedGeneratorJob.java:50)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)

http://issues.alfresco.com/jira/browse/ALF-8840
2 REPLIES 2

loftux
Star Contributor
Star Contributor
Edit alfresco/templates/activities/org/alfresco/site/user-joined.atomentry.ftl to do a check if memberFirstName exist before trying to assign it.
Example below

<#include "../slingshot-common.lib.ftl">
<#assign title><#if memberFirstName??>${memberFirstName?xml}</#if><#if memberLastName??> ${memberLastName?xml}</#if> joined ${siteNetwork?xml} site</#assign>
<entry xmlns='http://www.w3.org/2005/Atom'>
   <title>${title}</title>
   <link rel="alternate" type="text/html"/>
   <icon></icon>
   <id>http://www.alfresco.org/rss/atom/${id}</id>
   <updated>${xmldate(date)}</updated>
   <summary type="html">
      <![CDATA[${title} (with role ${role}).]]>
   </summary>
   <author>
      <name>${userName?xml}</name>
      <uri>${userId?xml}</uri>
   </author>
</entry>

dranakan
Champ on-the-rise
Champ on-the-rise
Thank you 🙂 All is working now