最近准备给自己搭建的 solo 博客换一个皮肤,感觉 yilia 挺好看的,切换了一下发现标签墙中的分类点击出现问题,然后在官方的示例中也看了一下,也有同样的问题。
日志中的错误如下,看上去应该是皮肤的模板问题有点问题。
[ERROR]-[2022-04-17 17:49:57]-[org.b3log.latke.http.renderer.AbstractFreeMarkerRenderer:104]: Renders template [category-articles.ftl] failed [Request [
method=GET,
URI=/category/tech,
contentType=null,
remoteAddr=
headers=[
Host=
Connection=keep-alive
Upgrade-Insecure-Requests=1
User-Agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36
Accept=text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Referer=
Accept-Encoding=gzip, deflate
Accept-Language=zh,zh-CN;q=0.9,en;q=0.8,zh-TW;q=0.7
Cookie=__gads=ID=8cd9cac3c1e5c58f-228acfeba1cb00cb:T=1631629169:RT=1631629169:S=ALNI_MbharWc02RW4zLxk4KhcQdNmeVkaw; __gads=ID=8cd9cac3c1e5c58f-228acfeba1cb00cb:T=1631629169:RT=1631629169:S=ALNI_MbharWc02RW4zLxk4KhcQdNmeVkaw; _ga_57HB28MTR5=GS1.1.1649774147.8.0.1649774147.0; Hm_lvt_770a4ac62c4d64e5bdc1e59443d24cfc=1634972768; _ga=GA1.1.838816994.1631629169; Hm_lvt_770a4ac62c4d64e5bdc1e59443d24cfc=1650107418; Hm_lpvt_770a4ac62c4d64e5bdc1e59443d24cfc=1650107418; _gid=GA1.2.1476963482.1650107419; Hm_lpvt_770a4ac62c4d64e5bdc1e59443d24cfc=1650107418; _gid=GA1.2.1476963482.1650107419; _ga=GA1.1.838816994.1631629169; LATKE_SESSION_ID=yNg076uvfNiGCMcV; solo=f49a1f0086f5d6b7c0c1f5aa8f2420f991c2835aec92a63e7549bab942f7496ddac4a3d33c7b2ec4653922c40c3355543ab6e3e9f1a9c1fc4f5074fd7225a99e; _ga_57HB28MTR5=GS1.1.1650188994.9.0.1650188994.0; _dd_s=logs=1&id=56fb8ebb-4168-449e-97b5-7ad00358fb9f&created=1650187788020&expire=1650189897156
content-length=0
]
]]
freemarker.core.InvalidReferenceException: The following has evaluated to null or missing:
==> category.categoryPublishedArticleCount [in template "skins/yilia/category-articles.ftl" at line 28, column 20]
----
Tip: It's the step after the last dot that caused this error, not those before it.
----
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: ${category.categoryPublishedArticleCo... [in template "skins/yilia/category-articles.ftl" at line 28, column 18]
----
at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:134) ~[freemarker-2.3.31.jar:2.3.31]
at freemarker.core.EvalUtil.coerceModelToTextualCommon(EvalUtil.java:481) ~[freemarker-2.3.31.jar:2.3.31]
at freemarker.core.EvalUtil.coerceModelToStringOrMarkup(EvalUtil.java:401) ~[freemarker-2.3.31.jar:2.3.31]
at freemarker.core.EvalUtil.coerceModelToStringOrMarkup(EvalUtil.java:370) ~[freemarker-2.3.31.jar:2.3.31]
at freemarker.core.DollarVariable.calculateInterpolatedStringOrMarkup(DollarVariable.java:100) ~[freemarker-2.3.31.jar:2.3.31]
at freemarker.core.DollarVariable.accept(DollarVariable.java:63) ~[freemarker-2.3.31.jar:2.3.31]
at freemarker.core.Environment.visit(Environment.java:347) ~[freemarker-2.3.31.jar:2.3.31]
at freemarker.core.Environment.visit(Environment.java:353) ~[freemarker-2.3.31.jar:2.3.31]
at freemarker.core.Environment.process(Environment.java:326) ~[freemarker-2.3.31.jar:2.3.31]
at freemarker.template.Template.process(Template.java:383) ~[freemarker-2.3.31.jar:2.3.31]
at org.b3log.latke.http.renderer.AbstractFreeMarkerRenderer.genHTML(AbstractFreeMarkerRenderer.java:127) ~[latke-core-3.4.26.jar:?]
at org.b3log.solo.processor.SkinRenderer.genHTML(SkinRenderer.java:81) ~[solo/:?]
at org.b3log.latke.http.renderer.AbstractFreeMarkerRenderer.render(AbstractFreeMarkerRenderer.java:98) ~[latke-core-3.4.26.jar:?]
at org.b3log.latke.http.Dispatcher.renderResponse(Dispatcher.java:120) ~[latke-core-3.4.26.jar:?]
at org.b3log.latke.http.Dispatcher.handle(Dispatcher.java:92) ~[latke-core-3.4.26.jar:?]
at org.b3log.latke.http.ServerHandler.channelRead0(ServerHandler.java:78) ~[latke-core-3.4.26.jar:?]
at org.b3log.latke.http.ServerHandler.channelRead0(ServerHandler.java:34) ~[latke-core-3.4.26.jar:?]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) ~[netty-transport-4.1.75.Final.jar:4.1.75.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-transport-4.1.75.Final.jar:4.1.75.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[netty-transport-4.1.75.Final.jar:4.1.75.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[netty-transport-4.1.75.Final.jar:4.1.75.Final]
at org.b3log.latke.http.WebSocketHandler.handleHttpRequest(WebSocketHandler.java:90) ~[latke-core-3.4.26.jar:?]
at org.b3log.latke.http.WebSocketHandler.channelRead0(WebSocketHandler.java:47) ~[latke-core-3.4.26.jar:?]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) ~[netty-transport-4.1.75.Final.jar:4.1.75.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-transport-4.1.75.Final.jar:4.1.75.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[netty-transport-4.1.75.Final.jar:4.1.75.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[netty-transport-4.1.75.Final.jar:4.1.75.Final]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[netty-codec-4.1.75.Final.jar:4.1.75.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-transport-4.1.75.Final.jar:4.1.75.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[netty-transport-4.1.75.Final.jar:4.1.75.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[netty-transport-4.1.75.Final.jar:4.1.75.Final]
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436) ~[netty-transport-4.1.75.Final.jar:4.1.75.Final]
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:327) ~[netty-codec-4.1.75.Final.jar:4.1.75.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:299) ~[netty-codec-4.1.75.Final.jar:4.1.75.Final]
at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251) ~[netty-transport-4.1.75.Final.jar:4.1.75.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-transport-4.1.75.Final.jar:4.1.75.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[netty-transport-4.1.75.Final.jar:4.1.75.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[netty-transport-4.1.75.Final.jar:4.1.75.Final]
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[netty-transport-4.1.75.Final.jar:4.1.75.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-transport-4.1.75.Final.jar:4.1.75.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[netty-transport-4.1.75.Final.jar:4.1.75.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[netty-transport-4.1.75.Final.jar:4.1.75.Final]
at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:800) ~[netty-transport-classes-epoll-4.1.75.Final.jar:4.1.75.Final]
at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:480) ~[netty-transport-classes-epoll-4.1.75.Final.jar:4.1.75.Final]
at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:378) ~[netty-transport-classes-epoll-4.1.75.Final.jar:4.1.75.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) ~[netty-common-4.1.75.Final.jar:4.1.75.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.75.Final.jar:4.1.75.Final]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.75.Final.jar:4.1.75.Final]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
欢迎来到这里!
我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。
注册 关于