"看是空指针的问题。blogTitle 怎么会为空呢,报错代码如下: [ERROR]-[2019-03-25 07:25:48]-[org.b3log.latke.servlet.HttpControl:104]: Request [ method=GET, URL=http://backend/, contentTyp .."

solo v2.3.0 升级到 v2.4.0 报错

看是空指针的问题。blogTitle 怎么会为空呢,报错代码如下:

[ERROR]-[2019-03-25 07:25:48]-[org.b3log.latke.servlet.HttpControl:104]: Request [
    method=GET,
    URL=http://backend/,
    contentType=null,
    characterEncoding=UTF-8,
    local=[
        addr=127.0.0.1,
        port=xx,
        name=127.0.0.1],
    remote=[
        addr=127.0.0.1,
        port=xxx,
        host=127.0.0.1],
    headers=[
        Cookie=b3log-latke="{\"userPassword\":\"11\",\"userEmail\":\"11@qq.com\"}"; skin=; visited="[\"/articles/2019/03/23/1553295398628.html\",\"/\",\"/archives.html\",\"/links.html\",\"/pages/1470814654552.html\",\"/articles/2016/08/30/1472545022261.html\"]"
        Accept=text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Upgrade-Insecure-Requests=1
        Connection=close
        User-Agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36
        Host=backend
        Accept-Encoding=gzip, deflate
        Accept-Language=zh-CN,zh;q=0.9,en;q=0.8
    ]
] processing failed
java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.b3log.latke.servlet.handler.MethodInvokeHandler.handle(MethodInvokeHandler.java:58)
	at org.b3log.latke.servlet.HttpControl.nextHandler(HttpControl.java:99)
	at org.b3log.latke.servlet.handler.AdviceHandler.handle(AdviceHandler.java:108)
	at org.b3log.latke.servlet.HttpControl.nextHandler(HttpControl.java:99)
	at org.b3log.latke.servlet.handler.ArgsHandler.handle(ArgsHandler.java:60)
	at org.b3log.latke.servlet.HttpControl.nextHandler(HttpControl.java:99)
	at org.b3log.latke.servlet.handler.RequestDispatchHandler.handle(RequestDispatchHandler.java:92)
	at org.b3log.latke.servlet.HttpControl.nextHandler(HttpControl.java:99)
	at org.b3log.latke.servlet.handler.RequestPrepareHandler.handle(RequestPrepareHandler.java:45)
	at org.b3log.latke.servlet.HttpControl.nextHandler(HttpControl.java:99)
	at org.b3log.latke.servlet.handler.StaticResourceHandler.handle(StaticResourceHandler.java:119)
	at org.b3log.latke.servlet.HttpControl.nextHandler(HttpControl.java:99)
	at org.b3log.latke.servlet.DispatcherServlet.service(DispatcherServlet.java:84)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
	at org.b3log.solo.filter.InitCheckFilter.doFilter(InitCheckFilter.java:87)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at org.b3log.solo.filter.PermalinkFilter.doFilter(PermalinkFilter.java:92)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at org.b3log.latke.servlet.filter.EncodingFilter.doFilter(EncodingFilter.java:71)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
	at org.eclipse.jetty.server.Server.handle(Server.java:497)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
	at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
	at org.b3log.solo.processor.util.Filler.fillIndexArticles(Filler.java:204)
	at org.b3log.solo.processor.util.Filler_$$_jvstf10_33._d5fillIndexArticles(Filler_$$_jvstf10_33.java)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.b3log.latke.ioc.bean.JavassistMethodHandler.invoke(JavassistMethodHandler.java:106)
	at org.b3log.solo.processor.util.Filler_$$_jvstf10_33.fillIndexArticles(Filler_$$_jvstf10_33.java)
	at org.b3log.solo.processor.IndexProcessor.showIndex(IndexProcessor.java:152)
	at org.b3log.solo.processor.IndexProcessor_$$_jvstf10_29._d8showIndex(IndexProcessor_$$_jvstf10_29.java)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.b3log.latke.ioc.bean.JavassistMethodHandler.invoke(JavassistMethodHandler.java:106)
	at org.b3log.solo.processor.IndexProcessor_$$_jvstf10_29.showIndex(IndexProcessor_$$_jvstf10_29.java)
	... 43 more
[ERROR]-[2019-03-25 07:25:48]-[org.b3log.latke.servlet.renderer.freemarker.AbstractFreeMarkerRenderer:138]: FreeMarker renders error
FreeMarker template error:
The following has evaluated to null or missing:
==> blogTitle  [in template "index.ftl" at line 5, column 25]

----
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):
	- Failed at: ${blogTitle}  [in template "index.ftl" at line 5, column 23]
	- Reached through: @head title="${blogTitle}"  [in template "index.ftl" at line 5, column 9]
----

Java stack trace (for programmers):
----
freemarker.core.InvalidReferenceException: [... Exception message was already printed; see it above ...]
	at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:131)
	at freemarker.core.EvalUtil.coerceModelToString(EvalUtil.java:355)
	at freemarker.core.Expression.evalAndCoerceToString(Expression.java:82)
	at freemarker.core.DollarVariable.accept(DollarVariable.java:41)
	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.renderElementToString(Environment.java:2196)
	at freemarker.core.StringLiteral.evalAndCoerceToString(StringLiteral.java:96)
	at freemarker.core.StringLiteral._eval(StringLiteral.java:73)
	at freemarker.core.Expression.eval(Expression.java:78)
	at freemarker.core.Environment.setMacroContextLocalsFromArguments(Environment.java:739)
	at freemarker.core.Environment.invoke(Environment.java:689)
	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 org.b3log.latke.servlet.renderer.freemarker.AbstractFreeMarkerRenderer.genHTML(AbstractFreeMarkerRenderer.java:162)
	at org.b3log.latke.servlet.renderer.freemarker.AbstractFreeMarkerRenderer.render(AbstractFreeMarkerRenderer.java:133)
	at org.b3log.latke.servlet.DispatcherServlet.result(DispatcherServlet.java:111)
	at org.b3log.latke.servlet.DispatcherServlet.service(DispatcherServlet.java:89)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
	at org.b3log.solo.filter.InitCheckFilter.doFilter(InitCheckFilter.java:87)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at org.b3log.solo.filter.PermalinkFilter.doFilter(PermalinkFilter.java:92)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at org.b3log.latke.servlet.filter.EncodingFilter.doFilter(EncodingFilter.java:71)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
	at org.eclipse.jetty.server.Server.handle(Server.java:497)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
	at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
	at java.lang.Thread.run(Thread.java:745)

  • Solo

    Solo 是一款小而美的开源博客系统,专为程序员设计。

    Solo 有着非常活跃的社区,可将文章作为帖子推送到社区,来自社区的回帖将作为博客评论进行联动。

    这是一种全新的网络社区体验,让热爱记录和分享的你不再感到孤单!
    具体细节请浏览 B3log 构思

    652 引用 • 4972 回帖 • 710 关注
  • Q&A

    提问之前请先看一下这篇文章 《提问的智慧》精读注解版,好的问题比好的答案更有价值。

    1040 引用 • 6631 回帖 • 595 关注
11 回帖   
请输入回帖内容...
  • guobingwei  

    我把那行代码加上空判断<@head title="${blogTitle!"BingBingBangg个人博客"}">,重新打包部署,就提示 index.ftl 找不到...

  • 88250

    你好,请参考这里进行修复。

    1 回复
  • guobingwei        

    我用内嵌的 h2,表结构好像不好看..

    1 回复
  • 88250      

    H2 官网上有工具可以进行数据库管理。

    2 回复
  • guobingwei        

    好的,3q

  • guobingwei        

    h2 起的哪个端口

    1 回复
  • 88250      

    默认没有用 TCP 模式,你看下 local.props 里面有数据库文件路径。

  • mufengcoding  

    你不该升级到 3.4 吗

    1 回复
  • guobingwei        

    好久没升级了,从 2.1.0 一版一版往上升。。。。可把我累坏了

    1 回复
  • mufengcoding        

    写脚本帮你升

    1 回复
  • guobingwei        

    哈哈,谢谢。我升完了。现在用 docker 了,还是挺方便的

请输入回帖内容 ...