FreeMarker template error (DEBUG mode; use RETHROW in production!):
Java method "cn.com.harbor.wcb.publish.service.CMSTemplateEngine.documents(String)" threw an exception when invoked on cn.com.harbor.wcb.publish.service.CMSTemplateEngine object "cn.com.harbor.wcb.publish.service.CMSTemplateEngine@239f7dcd"; see cause exception in the Java stack trace.
----
FTL stack trace ("~" means nesting-related):
- Failed at: #list cms.documents("channel=新闻中心_基层动... [in template "index.html" at line 74, column 9]
----
Java stack trace (for programmers):
----
freemarker.core._TemplateModelException: [... Exception message was already printed; see it above ...]
at freemarker.ext.beans._MethodUtil.newInvocationTemplateModelException(_MethodUtil.java:311)
at freemarker.ext.beans._MethodUtil.newInvocationTemplateModelException(_MethodUtil.java:275)
at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:80)
at freemarker.core.MethodCall._eval(MethodCall.java:62)
at freemarker.core.Expression.eval(Expression.java:78)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:58)
at freemarker.core.Environment.visit(Environment.java:312)
at freemarker.core.MixedContent.accept(MixedContent.java:62)
at freemarker.core.Environment.visit(Environment.java:312)
at freemarker.core.Environment.process(Environment.java:290)
at freemarker.template.Template.process(Template.java:312)
at cn.com.harbor.wcb.publish.service.HTMLGenerator.generateHTML(HTMLGenerator.java:59)
at cn.com.harbor.wcb.publish.service.ChannelIndexPublishThread.publishQuoteChannel(ChannelIndexPublishThread.java:155)
at cn.com.harbor.wcb.publish.service.ChannelIndexPublishThread.run(ChannelIndexPublishThread.java:53)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1967)
at cn.com.harbor.wcb.publish.service.CMSTemplateEngine.documents(CMSTemplateEngine.java:234)
at sun.reflect.GeneratedMethodAccessor227.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at freemarker.ext.beans.BeansWrapper.invokeMethod(BeansWrapper.java:1458)
at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:71)
... 16 more