JFinal-assets(线上css、js压缩插件) JFinal3.0 template中使用问题

[ERROR]-[Thread: qtp305623748-21]-[com.jfinal.core.ActionHandler.handle()]: /

com.jfinal.render.RenderException: java.lang.RuntimeException: java.lang.NullPointerException

at com.jfinal.render.TemplateRender.render(TemplateRender.java:63)

at com.jfinal.core.ActionHandler.handle(ActionHandler.java:99)

at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:74)

at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1307)

at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:453)

at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)

at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:560)

at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)

at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1072)

at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:382)

at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)

at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1006)

at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)

at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)

at org.eclipse.jetty.server.Server.handle(Server.java:365)

at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:485)

at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:926)

at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:988)

at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:635)

at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)

at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)

at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)

at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)

at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)

at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)

at java.lang.Thread.run(Unknown Source)

Caused by: java.lang.RuntimeException: java.lang.NullPointerException

at net.dreamlu.assets.ui.jfinal.AssetsDirective.exec(AssetsDirective.java:40)

at com.jfinal.template.stat.ast.StatList.exec(StatList.java:47)

at com.jfinal.template.stat.ast.Define.call(Define.java:105)

at com.jfinal.template.stat.ast.Call.exec(Call.java:49)

at com.jfinal.template.stat.ast.StatList.exec(StatList.java:47)

at com.jfinal.template.Template.render(Template.java:49)

at com.jfinal.render.TemplateRender.render(TemplateRender.java:61)

... 25 more

Caused by: java.lang.NullPointerException

at java.io.PrintWriter.write(Unknown Source)

at com.jfinal.template.stat.ast.Stat.write(Stat.java:57)

at net.dreamlu.assets.ui.jfinal.AssetsDirective.exec(AssetsDirective.java:38)

... 31 more


评论区

JFinal

2017-10-23 10:47

解决 NullPointerException 异常没有什么好说的了,单步调试找到那个引发异常的值为 null 的对象即可

JFinal

2017-10-23 10:48

JFinal-assets 这个项目是 @卢春梦 @如梦技术 写的

cyz1

2017-10-23 13:34

@JFinal 嗯,好的,谢谢

Dreamlu

2017-10-24 16:59

你不会是用的仓库的代码吧,仓库的代码是未完成改版的,Jar包下载:http://mvnrepository.com/artifact/net.dreamlu/JFinal-assets

热门反馈

扫码入社