JPressProjects / jpress

JPress,一个使用 Java 开发的建站神器,目前已经有 10w+ 网站使用 JPress 进行驱动,其中包括多个政府机构,200+上市公司,中科院、红+字会等。
http://www.jpress.cn
GNU Lesser General Public License v3.0
2.66k stars 1.18k forks source link

后台模板切换错误 #22

Closed yuandi0823 closed 5 years ago

yuandi0823 commented 8 years ago

切换THE3模板以后,系统前台无法显示。错误如下:

render : template is "THE3",template html is "index.html"

JFinal action report -------- 2016-09-02 00:00:28 ------------------------------ Controller : io.jpress.front.controller.IndexController.(IndexController.java:1) Method : index Interceptor : io.jpress.core.interceptor.JI18nInterceptor.(JI18nInterceptor.java:1) io.jpress.interceptor.AdminInterceptor.(AdminInterceptor.java:1)

io.jpress.core.interceptor.HookInterceptor.(HookInterceptor.java:1)

2016-09-02 00:00:28 [ERROR]-[Thread: btpool0-5]-[freemarker.log._Log4jLoggerFactory$Log4jLogger.error()]: Error executing FreeMarker template FreeMarker template error: The following has evaluated to null or missing: ==> menus [in template "templates/the3/_inc/_layout.html" at line 43, column 43]


Tip: If the failing expression is known to be 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):

freemarker.core.InvalidReferenceException: [... Exception message was already printed; see it above ...] at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:131) at freemarker.core.UnifiedCall.accept(UnifiedCall.java:111) at freemarker.core.Environment.visit(Environment.java:324) at freemarker.core.MixedContent.accept(MixedContent.java:54) at freemarker.core.Environment.visit(Environment.java:324) at freemarker.core.Macro$Context.runMacro(Macro.java:184) at freemarker.core.Environment.invoke(Environment.java:701) at freemarker.core.UnifiedCall.accept(UnifiedCall.java:84) at freemarker.core.Environment.visit(Environment.java:324) at freemarker.core.MixedContent.accept(MixedContent.java:54) at freemarker.core.Environment.visit(Environment.java:324) at freemarker.core.Environment.process(Environment.java:302) at freemarker.template.Template.process(Template.java:325) at io.jpress.core.render.JFreemarkerRender.getHtmlContent(JFreemarkerRender.java:114) at io.jpress.core.render.JFreemarkerRender.render(JFreemarkerRender.java:94) at com.jfinal.core.ActionHandler.handle(ActionHandler.java:97) at io.jpress.core.MyDruidStatViewHandler.handle(MyDruidStatViewHandler.java:43) at io.jpress.core.cache.ActionCacheHandler.handle(ActionCacheHandler.java:86) at io.jpress.core.JHandler.handle(JHandler.java:81) at io.jpress.core.cache.ActionCacheHandler.handle(ActionCacheHandler.java:86) at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:72) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:324) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:829) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)

2016-09-02 00:00:28

com.jfinal.render.RenderException: com.jfinal.render.RenderException: freemarker.core.InvalidReferenceException: The following has evaluated to null or missing: ==> menus [in template "templates/the3/_inc/_layout.html" at line 43, column 43]


Tip: If the failing expression is known to be 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):

at io.jpress.core.render.JFreemarkerRender.render(JFreemarkerRender.java:101)
at com.jfinal.core.ActionHandler.handle(ActionHandler.java:97)
at io.jpress.core.MyDruidStatViewHandler.handle(MyDruidStatViewHandler.java:43)
at io.jpress.core.cache.ActionCacheHandler.handle(ActionCacheHandler.java:86)
at io.jpress.core.JHandler.handle(JHandler.java:81)
at io.jpress.core.cache.ActionCacheHandler.handle(ActionCacheHandler.java:86)
at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:72)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:829)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)

Caused by: com.jfinal.render.RenderException: freemarker.core.InvalidReferenceException: The following has evaluated to null or missing: ==> menus [in template "templates/the3/_inc/_layout.html" at line 43, column 43]


Tip: If the failing expression is known to be 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):

at io.jpress.core.render.JFreemarkerRender.getHtmlContent(JFreemarkerRender.java:118)
at io.jpress.core.render.JFreemarkerRender.render(JFreemarkerRender.java:94)
... 23 more

Caused by: freemarker.core.InvalidReferenceException: The following has evaluated to null or missing: ==> menus [in template "templates/the3/_inc/_layout.html" at line 43, column 43]


Tip: If the failing expression is known to be 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):

at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:131)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:111)
at freemarker.core.Environment.visit(Environment.java:324)
at freemarker.core.MixedContent.accept(MixedContent.java:54)
at freemarker.core.Environment.visit(Environment.java:324)
at freemarker.core.Macro$Context.runMacro(Macro.java:184)
at freemarker.core.Environment.invoke(Environment.java:701)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:84)
at freemarker.core.Environment.visit(Environment.java:324)
at freemarker.core.MixedContent.accept(MixedContent.java:54)
at freemarker.core.Environment.visit(Environment.java:324)
at freemarker.core.Environment.process(Environment.java:302)
at freemarker.template.Template.process(Template.java:325)
at io.jpress.core.render.JFreemarkerRender.getHtmlContent(JFreemarkerRender.java:114)
... 24 more
hxsam commented 7 years ago

其实 THE3模板 只是在后台凑数显示模板个数用的,不能真正使用。

LuckClown commented 7 years ago

我也发现了这个问题,原来只是凑数用,,,,