AnsweredAssumed Answered

Server 500 error when selecting to create an RSS Feed

Question asked by smcardle on Aug 11, 2011
Hi All

I am using Alfresco 3.4.d Community edition on a windows XP box with locale set to en_US

I want to create an RSS feed from one of my Sites/Folders in Share, but when I select the RSS Feed button I get the following error


The Web Script /share/page/feed/components/documentlibrary/feed/documents/node/alfresco/company/home/ has responded with a status of 500 - Internal Error.

500 Description:   An error inside the HTTP server which prevented it from fulfilling the request.

Message:   07110023 Failed to process template org/alfresco/components/documentlibrary/feed.get.rss.ftl
   
Exception:   freemarker.template.TemplateModelException - Can't convert the date to string, because it is not known which parts of the date variable are in use. Use ?date, ?time or ?datetime built-in, or ?string.<format> or ?string(format) built-in with this date.
   
   freemarker.core.Environment.formatDate(Environment.java:765)
   freemarker.core.Expression.getStringValue(Expression.java:105)
   freemarker.core.Expression.getStringValue(Expression.java:93)
   freemarker.core.DollarVariable.accept(DollarVariable.java:76)
   freemarker.core.Environment.visit(Environment.java:210)
   freemarker.core.MixedContent.accept(MixedContent.java:92)
   freemarker.core.Environment.visit(Environment.java:210)
   freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79)
   freemarker.core.Environment.visit(Environment.java:210)
   freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:179)
   freemarker.core.Environment.visit(Environment.java:417)
   freemarker.core.IteratorBlock.accept(IteratorBlock.java:102)
   freemarker.core.Environment.visit(Environment.java:210)
   freemarker.core.MixedContent.accept(MixedContent.java:92)
   freemarker.core.Environment.visit(Environment.java:210)
   freemarker.core.Environment.process(Environment.java:190)
   org.springframework.extensions.webscripts.processor.FTLTemplateProcessor.process(FTLTemplateProcessor.java:171)
   org.springframework.extensions.webscripts.AbstractWebScript.renderTemplate(AbstractWebScript.java:589)
   org.springframework.extensions.webscripts.DeclarativeWebScript.renderFormatTemplate(DeclarativeWebScript.java:267)
   org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:147)
   org.springframework.extensions.webscripts.PresentationContainer.executeScript(PresentationContainer.java:69)
   org.springframework.extensions.webscripts.LocalWebScriptRuntimeContainer.executeScript(LocalWebScriptRuntimeContainer.java:231)
   org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:333)
   org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:189)
   org.springframework.extensions.webscripts.servlet.mvc.WebScriptView.renderMergedOutputModel(WebScriptView.java:99)
   org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
   org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1060)
   org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:798)
   org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
   org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647)
   org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:552)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
   org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
   org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
   org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
   org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:195)
   org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:159)
   org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141)
   org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90)
   org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:417)
   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
   org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)
   org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
   org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555)
   java.lang.Thread.run(Thread.java:619)
   
Exception:   org.springframework.extensions.webscripts.WebScriptException - 07110023 Failed to process template org/alfresco/components/documentlibrary/feed.get.rss.ftl
   
   org.springframework.extensions.webscripts.processor.FTLTemplateProcessor.process(FTLTemplateProcessor.java:175)
   
Server:   Spring WebScripts - v1.0.0 (Release Candidate 2 744) schema 1,000
Time:   11/08/2011 6:06:31 PM
   
Diagnostics:   Inspect Web Script (org/alfresco/components/documentlibrary/feed.get)

According to several JIRA's this has been fixed by using a new xmldate(…) function so why am I getting the error?????

My feed.get.rss.ftl file is as follows


<#function formatDate date><#return xmldate(date)?string(msg("date-format.defaultFTL"))></#function>
<#function siteLoc loc><#if (loc.site?length > 0)><#return "/page/site/" + loc.site + "/documentlibrary"><#else><#return "/page/repository"></#if></#function>
<#function location loc><#return absurl(url.context) + siteLoc(loc) + "?file=" + loc.file + "&amp;path=" + loc.path?url></#function>
<#function displayLocation loc><#return absurl(url.context) + siteLoc(loc) + "?file=" + loc.file + "&amp;path=" + loc.path></#function>
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
   <title>Alfresco Share - ${msg("feed.filter." + filter!"path")}</title>
   <link>${absurl(url.context)}/</link>
   <description>Alfresco Document List</description>
   <generator>Alfresco Share DocumentLibrary</generator>
<#assign proxyLink=absurl(url.context) + "/proxy/alfresco-feed/">
   <image>
      <title>Alfresco Share - ${msg("feed.filter." + filter!"path")}</title>
      <url>${absurl(url.context)}/themes/default/images/logo.png</url>
      <link>${absurl(url.context)}/</link>
   </image>
<#list items as item>
   <#if item.type == "document">
      <#assign isImage=(item.mimetype="image/gif" || item.mimetype="image/jpeg" || item.mimetype="image/png")>
      <#assign isMP3=(item.mimetype="audio/x-mpeg" || item.mimetype="audio/mpeg")>
   <item>
      <title>${item.displayName?html}</title>
      <description>
         &lt;img src=&quot;${proxyLink + "api/node/" + item.nodeRef?replace("://", "/") + "/content/thumbnails/doclib?c=queue&amp;ph=true"}&quot;&gt;${(item.description)!""?html}&lt;br /&gt;
         ${msg("feed.created", formatDate(item.createdOn), item.createdBy)}&lt;br /&gt;
         ${msg("feed.modified", formatDate(item.modifiedOn), item.modifiedBy)}&lt;br /&gt;
         ${msg("feed.location")}:&#160;&lt;a href="${location(item.location)}"&gt;${displayLocation(item.location)}&lt;/a&gt;
      </description>
      <link>${proxyLink + item.contentUrl}</link>
      <guid isPermaLink="false">${item.nodeRef}</guid>
      <#pubDate>${xmldate(item.modifiedOn)}</pubDate>
      <#if isMP3><enclosure url="${proxyLink + item.contentUrl}" length="${item.size}" type="audio/mpeg" /></#if>
   </item>
   </#if>
</#list>
</channel>
</rss>

If anybody has already fixed this I would like to know how, I have already tried changing the xmldate(…) to formatDate(…) as suggested in one post I found but with the same problem.


Best Regards

Steve

Outcomes