专题 | 喜迎党代会·郴州这五年FreeMarker template error (DEBUG mode; use RETHROW in production!):
The following has evaluated to null or missing:
==> (content.publishTimeStr) [in template "site_185//template/index.html" at line 605, column 152]
----
Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----
----
FTL stack trace ("~" means nesting-related):
- Failed at: ${(content.publishTimeStr)?date?strin... [in template "site_185//template/index.html" at line 605, column 150]
- Reached through: @_contentList id="ztxw_list" pageSize... [in template "site_185//template/index.html" at line 602, column 17]
----
Java stack trace (for programmers):
----
freemarker.core.InvalidReferenceException: [... Exception message was already printed; see it above ...]
at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:134)
at freemarker.core.EvalUtil.coerceModelToTextualCommon(EvalUtil.java:481)
at freemarker.core.EvalUtil.coerceModelToPlainText(EvalUtil.java:455)
at freemarker.core.Expression.evalAndCoerceToPlainText(Expression.java:117)
at freemarker.core.BuiltInsForMultipleTypes$dateBI._eval(BuiltInsForMultipleTypes.java:220)
at freemarker.core.Expression.eval(Expression.java:101)
at freemarker.core.BuiltInsForMultipleTypes$stringBI._eval(BuiltInsForMultipleTypes.java:732)
at freemarker.core.Expression.eval(Expression.java:101)
at freemarker.core.MethodCall._eval(MethodCall.java:55)
at freemarker.core.Expression.eval(Expression.java:101)
at freemarker.core.DefaultToExpression._eval(DefaultToExpression.java:96)
at freemarker.core.Expression.eval(Expression.java:101)
at freemarker.core.DollarVariable.calculateInterpolatedStringOrMarkup(DollarVariable.java:104)
at freemarker.core.DollarVariable.accept(DollarVariable.java:63)
at freemarker.core.Environment.visit(Environment.java:371)
at freemarker.core.IteratorBlock$IterationContext.executedNestedContentForCollOrSeqListing(IteratorBlock.java:321)
at freemarker.core.IteratorBlock$IterationContext.executeNestedContent(IteratorBlock.java:271)
at freemarker.core.IteratorBlock$IterationContext.accept(IteratorBlock.java:244)
at freemarker.core.Environment.visitIteratorBlock(Environment.java:645)
at freemarker.core.IteratorBlock.acceptWithResult(IteratorBlock.java:108)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:94)
at freemarker.core.Environment.visit(Environment.java:371)
at freemarker.core.Environment$NestedElementTemplateDirectiveBody.render(Environment.java:3423)
at cn.rednet.redcloud.template.freemarker.handler.TemplateDirectiveHandler.render(TemplateDirectiveHandler.java:67)
at cn.rednet.redcloud.template.freemarker.directive.ContentListDirective.execute(ContentListDirective.java:228)
at cn.rednet.redcloud.template.freemarker.base.impl.BaseTemplateDirective.execute(BaseTemplateDirective.java:27)
at freemarker.core.Environment.visit(Environment.java:452)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:102)
at freemarker.core.Environment.visit(Environment.java:335)
at freemarker.core.Environment.visit(Environment.java:341)
at freemarker.core.Environment.process(Environment.java:314)
at freemarker.template.Template.process(Template.java:383)
at cn.rednet.redcloud.template.service.impl.templatefile.TemplateFileService.generateFileByFile(TemplateFileService.java:737)
at cn.rednet.redcloud.template.service.impl.templatefile.TemplateFileService.generateStaticFileForTemplatePage(TemplateFileService.java:219)
at cn.rednet.redcloud.template.service.impl.templatefile.TemplateFileService$$FastClassBySpringCGLIB$$48aa813.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89)
at cn.rednet.redcloud.common.aspect.ClassMethodTimeAspect.aroundMethod(ClassMethodTimeAspect.java:82)
at sun.reflect.GeneratedMethodAccessor22.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:634)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:624)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:72)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708)
at cn.rednet.redcloud.template.service.impl.templatefile.TemplateFileService$$EnhancerBySpringCGLIB$$15d02957.generateStaticFileForTemplatePage()
at cn.rednet.redcloud.template.service.impl.TemplatePageServiceImpl.saveAndPublishTemplatePage(TemplatePageServiceImpl.java:315)
at cn.rednet.redcloud.template.service.impl.TemplatePageServiceImpl.saveAndPublishIndex(TemplatePageServiceImpl.java:600)
at cn.rednet.redcloud.template.service.impl.TemplatePageServiceImpl$$FastClassBySpringCGLIB$$92d4ea80.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89)
at cn.rednet.redcloud.common.aspect.ClassMethodTimeAspect.aroundMethod(ClassMethodTimeAspect.java:82)
at sun.reflect.GeneratedMethodAccessor22.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:634)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:624)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:72)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708)
at cn.rednet.redcloud.template.service.impl.TemplatePageServiceImpl$$EnhancerBySpringCGLIB$$cefe2b36.saveAndPublishIndex()
at cn.rednet.redcloud.template.schedule.IndexStaticJob.lambda$generateIndex$0(IndexStaticJob.java:68)
at java.util.ArrayList.forEach(ArrayList.java:1257)
at cn.rednet.redcloud.template.schedule.IndexStaticJob.generateIndex(IndexStaticJob.java:63)
at cn.rednet.redcloud.template.schedule.IndexStaticJob.execute(IndexStaticJob.java:48)
at com.xxl.job.core.thread.JobThread.run(JobThread.java:152)
FreeMarker template error (DEBUG mode; use RETHROW in production!):
No error description was specified for this error; low-level message: cn.rednet.redcloud.common.exception.FreeMarkerException: freemarker.core.InvalidReferenceException: The following has evaluated to null or missing:
==> (content.publishTimeStr) [in template "site_185//template/index.html" at line 605, column 152]
----
Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----
----
FTL stack trace ("~" means nesting-related):
- Failed at: ${(content.publishTimeStr)?date?strin... [in template "site_185//template/index.html" at line 605, column 150]
- Reached through: @_contentList id="ztxw_list" pageSize... [in template "site_185//template/index.html" at line 602, column 17]
----
----
FTL stack trace ("~" means nesting-related):
- Failed at: @_contentList id="ztxw_list" pageSize... [in template "site_185//template/index.html" at line 602, column 17]
----
Java stack trace (for programmers):
----
freemarker.template.TemplateException: [... Exception message was already printed; see it above ...]
at cn.rednet.redcloud.template.freemarker.base.impl.BaseTemplateDirective.execute(BaseTemplateDirective.java:31)
at freemarker.core.Environment.visit(Environment.java:452)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:102)
at freemarker.core.Environment.visit(Environment.java:335)
at freemarker.core.Environment.visit(Environment.java:341)
at freemarker.core.Environment.process(Environment.java:314)
at freemarker.template.Template.process(Template.java:383)
at cn.rednet.redcloud.template.service.impl.templatefile.TemplateFileService.generateFileByFile(TemplateFileService.java:737)
at cn.rednet.redcloud.template.service.impl.templatefile.TemplateFileService.generateStaticFileForTemplatePage(TemplateFileService.java:219)
at cn.rednet.redcloud.template.service.impl.templatefile.TemplateFileService$$FastClassBySpringCGLIB$$48aa813.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89)
at cn.rednet.redcloud.common.aspect.ClassMethodTimeAspect.aroundMethod(ClassMethodTimeAspect.java:82)
at sun.reflect.GeneratedMethodAccessor22.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:634)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:624)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:72)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708)
at cn.rednet.redcloud.template.service.impl.templatefile.TemplateFileService$$EnhancerBySpringCGLIB$$15d02957.generateStaticFileForTemplatePage()
at cn.rednet.redcloud.template.service.impl.TemplatePageServiceImpl.saveAndPublishTemplatePage(TemplatePageServiceImpl.java:315)
at cn.rednet.redcloud.template.service.impl.TemplatePageServiceImpl.saveAndPublishIndex(TemplatePageServiceImpl.java:600)
at cn.rednet.redcloud.template.service.impl.TemplatePageServiceImpl$$FastClassBySpringCGLIB$$92d4ea80.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89)
at cn.rednet.redcloud.common.aspect.ClassMethodTimeAspect.aroundMethod(ClassMethodTimeAspect.java:82)
at sun.reflect.GeneratedMethodAccessor22.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:634)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:624)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:72)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708)
at cn.rednet.redcloud.template.service.impl.TemplatePageServiceImpl$$EnhancerBySpringCGLIB$$cefe2b36.saveAndPublishIndex()
at cn.rednet.redcloud.template.schedule.IndexStaticJob.lambda$generateIndex$0(IndexStaticJob.java:68)
at java.util.ArrayList.forEach(ArrayList.java:1257)
at cn.rednet.redcloud.template.schedule.IndexStaticJob.generateIndex(IndexStaticJob.java:63)
at cn.rednet.redcloud.template.schedule.IndexStaticJob.execute(IndexStaticJob.java:48)
at com.xxl.job.core.thread.JobThread.run(JobThread.java:152)
Caused by: cn.rednet.redcloud.common.exception.FreeMarkerException: freemarker.core.InvalidReferenceException: The following has evaluated to null or missing:
==> (content.publishTimeStr) [in template "site_185//template/index.html" at line 605, column 152]
----
Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----
----
FTL stack trace ("~" means nesting-related):
- Failed at: ${(content.publishTimeStr)?date?strin... [in template "site_185//template/index.html" at line 605, column 150]
- Reached through: @_contentList id="ztxw_list" pageSize... [in template "site_185//template/index.html" at line 602, column 17]
----
at cn.rednet.redcloud.template.freemarker.handler.TemplateDirectiveHandler.render(TemplateDirectiveHandler.java:70)
at cn.rednet.redcloud.template.freemarker.directive.ContentListDirective.execute(ContentListDirective.java:228)
at cn.rednet.redcloud.template.freemarker.base.impl.BaseTemplateDirective.execute(BaseTemplateDirective.java:27)
... 60 more
Caused by: freemarker.core.InvalidReferenceException: The following has evaluated to null or missing:
==> (content.publishTimeStr) [in template "site_185//template/index.html" at line 605, column 152]
----
Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----
----
FTL stack trace ("~" means nesting-related):
- Failed at: ${(content.publishTimeStr)?date?strin... [in template "site_185//template/index.html" at line 605, column 150]
- Reached through: @_contentList id="ztxw_list" pageSize... [in template "site_185//template/index.html" at line 602, column 17]
----
at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:134)
at freemarker.core.EvalUtil.coerceModelToTextualCommon(EvalUtil.java:481)
at freemarker.core.EvalUtil.coerceModelToPlainText(EvalUtil.java:455)
at freemarker.core.Expression.evalAndCoerceToPlainText(Expression.java:117)
at freemarker.core.BuiltInsForMultipleTypes$dateBI._eval(BuiltInsForMultipleTypes.java:220)
at freemarker.core.Expression.eval(Expression.java:101)
at freemarker.core.BuiltInsForMultipleTypes$stringBI._eval(BuiltInsForMultipleTypes.java:732)
at freemarker.core.Expression.eval(Expression.java:101)
at freemarker.core.MethodCall._eval(MethodCall.java:55)
at freemarker.core.Expression.eval(Expression.java:101)
at freemarker.core.DefaultToExpression._eval(DefaultToExpression.java:96)
at freemarker.core.Expression.eval(Expression.java:101)
at freemarker.core.DollarVariable.calculateInterpolatedStringOrMarkup(DollarVariable.java:104)
at freemarker.core.DollarVariable.accept(DollarVariable.java:63)
at freemarker.core.Environment.visit(Environment.java:371)
at freemarker.core.IteratorBlock$IterationContext.executedNestedContentForCollOrSeqListing(IteratorBlock.java:321)
at freemarker.core.IteratorBlock$IterationContext.executeNestedContent(IteratorBlock.java:271)
at freemarker.core.IteratorBlock$IterationContext.accept(IteratorBlock.java:244)
at freemarker.core.Environment.visitIteratorBlock(Environment.java:645)
at freemarker.core.IteratorBlock.acceptWithResult(IteratorBlock.java:108)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:94)
at freemarker.core.Environment.visit(Environment.java:371)
at freemarker.core.Environment$NestedElementTemplateDirectiveBody.render(Environment.java:3423)
at cn.rednet.redcloud.template.freemarker.handler.TemplateDirectiveHandler.render(TemplateDirectiveHandler.java:67)
... 62 more