Fixed: FreeMarker template error! ... please help

Submitted by hanumant on Sat, 2009-04-25 07:53.Troubleshooting

Hi All,

I have installed DBSight and done all the required setup. I am able to index my database. But I am getting error while using search functionality. Its because of some template parsing issue.
Have anyone faced such issue before. Please help me to solve this issue.
Following is the stacktrace.

Error parsing included template templates/iknow/iKnow/documents.ftl
Unexpected end of file reached.
Unclosed foreach directive.

The problematic instruction:
----------
==> include "documents.ftl" [on line 20, column 23 in templates/iknow/iKnow/main.ftl]
in user-directive layout [on line 5, column 1 in templates/iknow/iKnow/main.ftl]
----------

Java backtrace for programmers:
----------
freemarker.template.TemplateException: Error parsing included template templates/iknow/iKnow/documents.ftl
Unexpected end of file reached.
Unclosed foreach directive.

at freemarker.core.Include.accept(Include.java:162)
at freemarker.core.Environment.visit(Environment.java:209)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:209)
at freemarker.core.Environment.visit(Environment.java:394)
at freemarker.core.BodyInstruction.accept(BodyInstruction.java:93)
at freemarker.core.Environment.visit(Environment.java:209)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:209)
at freemarker.core.Macro$Context.runMacro(Macro.java:168)
at freemarker.core.Environment.visit(Environment.java:602)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:106)
at freemarker.core.Environment.visit(Environment.java:209)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:209)
at freemarker.core.Environment.process(Environment.java:189)
at freemarker.template.Template.process(Template.java:237)
at freemarker.ext.servlet.FreemarkerServlet.process(FreemarkerServlet.java:458)
at freemarker.ext.servlet.FreemarkerServlet.doGet(FreemarkerServlet.java:397)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1056)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:388)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:231)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1158)
at net.javacoding.xsearch.servlet.ActionEncodingServlet.process(DBSight:42)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Unknown Source)
Caused by: freemarker.core.ParseException: Unexpected end of file reached.
Unclosed foreach directive.

at freemarker.core.FMParser.generateParseException(FMParser.java:4697)
at freemarker.core.FMParser.jj_consume_token(FMParser.java:4568)

thanks in advance
Hanumant

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Submitted by chris on Sun, 2009-04-26 12:00.

Hanumant, Please export your index configuration from the dashboard and send it to support at dbsight dot com

Submitted by mmasters on Tue, 2009-04-28 08:52.

I'm having the same issue. I've created mine from 'Search Engine'. Although, I did have null pointer exceptions I had to deal with. I'm not sure what was causing these, but they were in the log. I basically made sure I had a value in for every field when I was creating from scaffold.

Once the template was successfully created, it now blows up when I try to use it. The problem is coming from documents.flt. This is what I have in that file:

<#if (searchResult.docs?has_content || searchResult.docs.size() > 0) >
<#foreach doc in searchResult.docs>
<p class="g">
<a target="_blank" href="http://www.abcdefg.com/id=${number.format("0",doc.get("OID"))}">
</a><br />
<font size="-1"></font>
<br/><b>1</b>:

Expression column.isDate is undefined on line 15, column 11 in documents.ftl.scaffold.
The problematic instruction:
----------
==> if-else [on line 15, column 6 in documents.ftl.scaffold]
----------

It would be nice to have a fix for this. I'd like to demo it to our staff on Thursday.

Submitted by chris on Tue, 2009-04-28 13:09.

This particular error could be different from the original error in the discussion thread.

Do you have a column named "1", and somehow the configuration could not find the column?

Submitted by hanumant on Mon, 2009-05-04 10:32.

Hi,
I sent a mail with index configuration attached but there is no reply.
Please help me to solve this issue.
I have to present this POC at the earliest.

Thanks,
Hanumant

Submitted by marcv on Wed, 2009-05-06 11:14.

Same here on my other issue where my incremental was freezing. I emailed index about a week ago and no reply still. Chris typically was getting back to me literally within minutes to hours whether email or this support forum and all of a sudden he's gone completely dark. This is very unusual. I hope he is ok.

I know DBsight is a small team of 3 I think but I was hoping somebody else would pickup for him if he was out for some reason. I hope somebody fields all these support issues soon. We are evaluating for purchase and want to be comfortable that support will always be swift when we need it if we hinge our own business on DBsight search product.

Submitted by will on Wed, 2009-05-06 18:48.

Sorry to reply late. This is fixed now in the latest beta release.