Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE is thrown while writing the response [SPR-14941] #19508

Closed
spring-issuemaster opened this issue Nov 23, 2016 · 2 comments

Comments

@spring-issuemaster
Copy link
Collaborator

commented Nov 23, 2016

Violeta Georgieva opened SPR-14941 and commented

o.s.http.server.reactive.AbstractResponseBodyProcessor.State.REQUESTED state:

  • onNext is invoked with a non empty DataBuffer
  • The state is changed to RECEIVED, but the DataBuffer is still not processed
    (o.s.http.server.reactive.AbstractResponseBodyProcessor.receiveBuffer(DataBuffer) is not invoked)
  • At that moment the web container sends event onWritePossible,
    but as the DataBuffer is still not processed, NPE is thrown when trying to write the response.
java.lang.NullPointerException: null
at org.springframework.http.server.reactive.ServletServerHttpResponse$ResponseBodyProcessor.write(ServletServerHttpResponse.java:215)
at org.springframework.http.server.reactive.AbstractResponseBodyProcessor$State$3.onWritePossible(AbstractResponseBodyProcessor.java:253)
at org.springframework.http.server.reactive.AbstractResponseBodyProcessor.onWritePossible(AbstractResponseBodyProcessor.java:113)
at org.springframework.http.server.reactive.ServletServerHttpResponse$ResponseBodyWriteListener.onWritePossible(ServletServerHttpResponse.java:247)
at org.eclipse.jetty.server.HttpOutput.run(HttpOutput.java:996)
at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1286)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:428)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
at java.lang.Thread.run(Thread.java:745)

Affects: 5.0 M3

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Nov 23, 2016

Violeta Georgieva commented

Pull Request is provided
#1243

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Nov 24, 2016

Arjen Poutsma commented

Merged. Thanks for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.