AnsweredAssumed Answered

Hash error in webscript

Question asked by joshna on Sep 8, 2008
Latest reply on Sep 9, 2008 by joshna
Hi
I got struck with this error in webscript…


[u][color=#0000FF][/color]Error[/u]


Web Script Status 500 - Internal Error

The Web Script /alfresco/service/Test 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: Error during processing of the template 'Expected hash. userhome evaluated instead to freemarker.template.SimpleSequence on line 6, column 9 in retrieve.get.html.ftl.'. Please contact your system administrator. 
  
Exception: freemarker.template.TemplateException - Expected hash. userhome evaluated instead to freemarker.template.SimpleSequence on line 6, column 9 in retrieve.get.html.ftl. 
   
freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:135) 
freemarker.core.Dot._getAsTemplateModel(Dot.java:78) 
freemarker.core.Expression.getAsTemplateModel(Expression.java:89) 
freemarker.core.IteratorBlock.accept(IteratorBlock.java:87) 
freemarker.core.Environment.visit(Environment.java:196) 
freemarker.core.MixedContent.accept(MixedContent.java:92) 
freemarker.core.Environment.visit(Environment.java:196) 
freemarker.core.Environment.process(Environment.java:176) 
freemarker.template.Template.process(Template.java:232) 
org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:201) 
org.alfresco.web.scripts.AbstractWebScript.renderTemplate(AbstractWebScript.java:262) 
org.alfresco.web.scripts.DeclarativeWebScript.renderFormatTemplate(DeclarativeWebScript.java:249) 
org.alfresco.web.scripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:155) 
org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:263) 
org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:230) 
org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:227) 
org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:130) 
org.alfresco.web.scripts.servlet.WebScriptServlet.service(WebScriptServlet.java:108) 
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.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:595) 
   
Exception: org.alfresco.service.cmr.repository.TemplateException - Error during processing of the template 'Expected hash. userhome evaluated instead to freemarker.template.SimpleSequence on line 6, column 9 in retrieve.get.html.ftl.'. Please contact your system administrator. 
   
org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:205) 
   
Server: Alfresco Community Network v2.9.0 (B 683) schema 116 
Time: Sep 8, 2008 3:13:05 PM 
  
Diagnostics: Inspect Web Script (retrieve.get) 

[u]color=#FF0000]u]desc.xml[/color][/u]
<webscript>
<shortname>Get all Text files</shortname>
<description>Returns a list of data</description>
<url>/Test</url>
<authentication>admin</authentication>
<transaction>none</transaction>
</webscript>



[u][color=#FF0000]html.ftl[/color][/u]
<#assign datetimeformat="EEE, dd MMM yyyy HH:mm:ss zzz">
<html>
<body>
<h3>Data</h3>
<table>
<#list userhome.children as child>
   Name:<tr><td>${child.userhome.properties.name}</td></tr>
  </#list>
</table>
</body>
</html>



[u]Js[color=#FF4000][/color][/u]
var userhome = search.luceneSearch("PATH:\"/{http://www.alfresco.org/model/application/1.0}company_home/{http://www.alfresco.org/model/application/1.0}user_homes\"");
model.userhome=userhome;

help me out..


Thanks in advance,
Joshna.

Outcomes