从Play框架获取NullPointerException

我一直在使用play framework 2.2.4版本 . 在执行特定操作时获取 NullPointerException ,如果从我的代码中我可以修复它,但它来自播放库 .

有人可以帮忙吗?

# action #
public static Result getOverViewPage(final String errorMsg){   

    String autoBillStatusMsg = "";
    //business logic is here
    Logger.info("Final Auto-pay status message : "+autoBillStatusMsg);
    return ok(rave_customer_index.render());
}

我们可以看到上面的 Logger 声明 . 但在那之后我们得到了NullPointerException

异常StackTrace

INFO | jvm 1 | 2015/09/18 15:15:24 | [info] application - 最终自动付款状态消息:INFO | jvm 1 | 2015/09/18 15:15:24 | [error] play - 无法调用动作,最终出错:java.lang.NullPointerException INFO | jvm 1 | 2015/09/18 15:15:24 | [错误]申请 - 信息| jvm 1 | 2015/09/18 15:15:24 |信息| jvm 1 | 2015/09/18 15:15:24 | ! @ 6nfm0a093 - 内部服务器错误,对于(GET)[/] - > INFO | jvm 1 | 2015/09/18 15:15:24 |信息| jvm 1 | 2015/09/18 15:15:24 | play.api.Application $$ anon $ 1:执行异常[[NullPointerException:null]] INFO | jvm 1 | 2015/09/18 15:15:24 | at play.api.Application $ class.handleError(Application.scala:296)〜[com.typesafe.play.play_2.11-2.3.2.jar:2.3.2] INFO | jvm 1 | 2015/09/18 15:15:24 | at play.api.DefaultApplication.handleError(Application.scala:402)[com.typesafe.play.play_2.11-2.3.2.jar:2.3.2] INFO | jvm 1 | 2015/09/18 15:15:24 | at play.core.server.netty.PlayDefaultUpstreamHandler $$ anonfun $ 3 $$ anonfun $ applyOrElse $ 4.apply(PlayDefaultUpstreamHandler.scala:320)[com.typesafe.play.play_2.11-2.3.2.jar:2.3.2]信息| jvm 1 | 2015/09/18 15:15:24 | at play.core.server.netty.PlayDefaultUpstreamHandler $$ anonfun $ 3 $$ anonfun $ applyOrElse $ 4.apply(PlayDefaultUpstreamHandler.scala:320)[com.typesafe.play.play_2.11-2.3.2.jar:2.3.2]信息| jvm 1 | 2015/09/18 15:15:24 |在scala.Option.map(Option.scala:145)[org.scala-lang.scala-library-2.11.1.jar:na] INFO | jvm 1 | 2015/09/18 15:15:24 |引起:java.lang.NullPointerException:null INFO | jvm 1 | 2015/09/18 15:15:24 | at java.net.URLEncoder.encode(URLEncoder.java:205)〜[na:1.7.0_21] INFO | jvm 1 | 2015/09/18 15:15:24 | at play.api.mvc.CookieBaker $$ anonfun $ 3.apply(Http.scala:427)〜[com.typesafe.play.play_2.11-2.3.2.jar:2.3.2] INFO | jvm 1 | 2015/09/18 15:15:24 | at play.api.mvc.CookieBaker $$ anonfun $ 3.apply(Http.scala:426)〜[com.typesafe.play.play_2.11-2.3.2.jar:2.3.2] INFO | jvm 1 | 2015/09/18 15:15:24 |在scala.collection.TraversableLike $$ anonfun $ map $ 1.apply(TraversableLike.scala:245)〜[org.scala-lang.scala-library-2.11.1.jar:na] INFO | jvm 1 | 2015/09/18 15:15:24 |在scala.collection.TraversableLike $$ anonfun $ map $ 1.apply(TraversableLike.scala:245)〜[org.scala-lang.scala-library-2.11.1.jar:na] DEBUG | wrapperp | 2015/09/18 15:15:25 |发送数据包PING:ping INFO | jvm 1 | 2015/09/18 15:15:26 | WrapperManager Debug:收到一个包PING:ping INFO | jvm 1 | 2015/09/18 15:15:26 | WrapperManager Debug:发送数据包PING:ping

回答(0)