webscript error

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2008 07:19 AM
Hi I hav some problem with webscripts,
My error
500 Description: An error inside the HTTP server which prevented it from fulfilling the request.
Message: Error during processing of the template 'Expression whitepapers is undefined on line 6, column 8 in retrieve.get.html.ftl.'. Please contact your system administrator.
Exception: freemarker.core.InvalidReferenceException - Expression whitepapers is undefined on line 6, column 8 in retrieve.get.html.ftl.
freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
freemarker.core.IteratorBlock.accept(IteratorBlock.java:93)
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 'Expression whitepapers is undefined on line 6, column 8 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 1, 2008 4:45:07 PM
Diagnostics: Inspect Web Script (retrieve.get)
these are my files
desc.xml
<webscript>
<shortname>Get all Text files</shortname>
<description>Returns a list of data with extesion text</description>
<url>/retrieve/whitepapers</url>
<authentication>admin</authentication>
<transaction>none</transaction>
</webscript>
html.ftl
#assign datetimeformat="EEE, dd MMM yyyy HH:mm:ss zzz">
<html>
<body>
<h3>Data</h3>
<table>
<#list whitepapers as child>
<tr>
<td><b>Title</b></td><td>${child.whitepaper.properties.title}</td>
</tr>
<tr>
<td><b>Author</b></td><td>${child.whitepaper.properties.author}</td>
</tr>
<tr>
<td><b>Size</b></td><td>${child.whitepaper.properties.size}</td>
</tr>
</#list>
</table>
</body>
</html>
.js file
var whitepapers = search.luceneSearch("PATH:\"/{http://www.alfresco.org/model/application/1.0}company_home/{http://www.alfresco.org/model/content/1...."");
if(whitepapers==null)
{
status.code=404;
}
model.resultset=whitepapers;
My error
500 Description: An error inside the HTTP server which prevented it from fulfilling the request.
Message: Error during processing of the template 'Expression whitepapers is undefined on line 6, column 8 in retrieve.get.html.ftl.'. Please contact your system administrator.
Exception: freemarker.core.InvalidReferenceException - Expression whitepapers is undefined on line 6, column 8 in retrieve.get.html.ftl.
freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
freemarker.core.IteratorBlock.accept(IteratorBlock.java:93)
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 'Expression whitepapers is undefined on line 6, column 8 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 1, 2008 4:45:07 PM
Diagnostics: Inspect Web Script (retrieve.get)
these are my files
desc.xml
<webscript>
<shortname>Get all Text files</shortname>
<description>Returns a list of data with extesion text</description>
<url>/retrieve/whitepapers</url>
<authentication>admin</authentication>
<transaction>none</transaction>
</webscript>
html.ftl
#assign datetimeformat="EEE, dd MMM yyyy HH:mm:ss zzz">
<html>
<body>
<h3>Data</h3>
<table>
<#list whitepapers as child>
<tr>
<td><b>Title</b></td><td>${child.whitepaper.properties.title}</td>
</tr>
<tr>
<td><b>Author</b></td><td>${child.whitepaper.properties.author}</td>
</tr>
<tr>
<td><b>Size</b></td><td>${child.whitepaper.properties.size}</td>
</tr>
</#list>
</table>
</body>
</html>
.js file
var whitepapers = search.luceneSearch("PATH:\"/{http://www.alfresco.org/model/application/1.0}company_home/{http://www.alfresco.org/model/content/1...."");
if(whitepapers==null)
{
status.code=404;
}
model.resultset=whitepapers;
Labels:
- Labels:
-
Archive
3 REPLIES 3

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2008 08:10 AM
Hi Belmikki,
I tried but the error is
Web Script Status 500 - Internal Error
The Web Script /alfresco/service/retrieve/whitepapers 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 'Expression model is undefined on line 6, column 8 in retrieve.get.html.ftl.'. Please contact your system administrator.
Exception: freemarker.core.InvalidReferenceException - Expression model is undefined on line 6, column 8 in retrieve.get.html.ftl.
freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:134)
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 'Expression model is undefined on line 6, column 8 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 1, 2008 5:37:46 PM
Diagnostics: Inspect Web Script (retrieve.get)
I tried but the error is
Web Script Status 500 - Internal Error
The Web Script /alfresco/service/retrieve/whitepapers 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 'Expression model is undefined on line 6, column 8 in retrieve.get.html.ftl.'. Please contact your system administrator.
Exception: freemarker.core.InvalidReferenceException - Expression model is undefined on line 6, column 8 in retrieve.get.html.ftl.
freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:134)
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 'Expression model is undefined on line 6, column 8 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 1, 2008 5:37:46 PM
Diagnostics: Inspect Web Script (retrieve.get)

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2008 08:26 AM
Hi,
you named your whitepapers resultset in your JS-file.
so, your last line in your JS should be
Cheers, jan
you named your whitepapers resultset in your JS-file.
so, your last line in your JS should be
model.whitepapers=whitepapers;
then you are able accessing your whitepapers under the key whitepapers in your template.Cheers, jan

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2008 02:51 AM
Hi all
I got this error rectified.Since i have been using the TYPE in the lucene search query(In my Javascript file).I have created a customized content type.
now its working fine..
thank you all
regards,
Joshna
I got this error rectified.Since i have been using the TYPE in the lucene search query(In my Javascript file).I have created a customized content type.
now its working fine..
thank you all
regards,
Joshna
