Error in requestLoop() java.lang.NullPointerException
See original GitHub issueSorry, this is going to sound really vague but I get the following stacktrace pretty frequently on a server when (I assume) it accepts PUT
requests.
I don’t have much to go on here so thought I’d post an issue for a few pointers to help me debug. The server is pretty simple, started up like below and runs just a few HttpService
endpoints.
private def build(): Task[org.http4s.server.Server] = BlazeBuilder
.withServiceExecutor(DefaultExecutorService)
.bindHttp(port, "0.0.0.0")
.mountService(services(), "/")
.start
The PUT
sends a simple JSON body. Not sure what else I can tell you… oh, I’m on 2.12 / 0.16.3a
The stack trace is below
[blaze-nio-fixed-selector-pool-2] ERROR org.http4s.blaze.pipeline.Stage - error in requestLoop()
java.lang.NullPointerException
at org.http4s.internal.parboiled2.ParserInput$StringBasedParserInput.length(ParserInput.scala:97)
at org.http4s.internal.parboiled2.Parser.__advance(Parser.scala:228)
at org.http4s.internal.parboiled2.Parser.runRule$1(Parser.scala:140)
at org.http4s.internal.parboiled2.Parser.phase0_initialRun$1(Parser.scala:150)
at org.http4s.internal.parboiled2.Parser.__run(Parser.scala:203)
at org.http4s.parser.Rfc2616BasicRules$.token(Rfc2616BasicRules.scala:84)
at org.http4s.Method$.$anonfun$fromString$1(Method.scala:47)
at scala.collection.MapLike.getOrElse(MapLike.scala:128)
at scala.collection.MapLike.getOrElse$(MapLike.scala:126)
at scala.collection.concurrent.TrieMap.getOrElse(TrieMap.scala:631)
at org.http4s.Method$.fromString(Method.scala:47)
at org.http4s.server.blaze.Http1ServerParser.collectMessage(Http1ServerParser.scala:48)
at org.http4s.server.blaze.Http1ServerStage.runRequest(Http1ServerStage.scala:111)
at org.http4s.server.blaze.Http1ServerStage.reqLoopCallback(Http1ServerStage.scala:97)
at org.http4s.server.blaze.Http1ServerStage.$anonfun$requestLoop$1(Http1ServerStage.scala:74)
at org.http4s.server.blaze.Http1ServerStage.$anonfun$requestLoop$1$adapted(Http1ServerStage.scala:74)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
at org.http4s.blaze.util.Execution$$anon$1.execute(Executor.scala:27)
at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:68)
at scala.concurrent.impl.Promise$DefaultPromise.$anonfun$tryComplete$1(Promise.scala:284)
at scala.concurrent.impl.Promise$DefaultPromise.$anonfun$tryComplete$1$adapted(Promise.scala:284)
at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:284)
at org.http4s.blaze.channel.nio1.NIO1HeadStage.readReady(NIO1HeadStage.scala:61)
at org.http4s.blaze.channel.nio1.SelectorLoop.run(SelectorLoop.scala:134)
Issue Analytics
- State:
- Created 6 years ago
- Comments:34 (25 by maintainers)
Top Results From Across the Web
Getting java.lang.NullPointerException error while running ...
If the error comes from the DriverScript function you would get the following message : File Not Found java.lang.NullPointerException.
Read more >A null pointer exception is encountered when attempting to ...
PI63141: A null pointer exception is encountered when attempting to servi ce a request through the Java ODR causing the request to fail....
Read more >CHANGELOG-6.x
[WICKET-5134] - java.lang.NullPointerException at org.apache.wicket.markup.html.form.Form.onComponentTag(Form.java:1520) during Atmosphere eventbus.post() ...
Read more >availables.xml - MIT
com.intellij.modules.lang 3.6 SamePlugin SamePlugin Plugin for finding duplication ... 1.0.2 - Fix for null pointer exception when committing non-java files ...
Read more >Search Results - CVE
Play Framework is a web framework for Java and Scala. Verions prior to 2.8.16 are vulnerable to generation of error messages containing sensitive...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We have been running with this fix in production for roughly 18 hours and haven’t encountered the NPE yet. 😃
@aspic, fantastic! Thanks for reporting back the results. As @rossabaker said, if this pops up again please reopen.