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 when closing OutputBuffer #2214

Open
MarcelMerkle opened this issue Oct 21, 2024 · 0 comments
Open

NPE when closing OutputBuffer #2214

MarcelMerkle opened this issue Oct 21, 2024 · 0 comments

Comments

@MarcelMerkle
Copy link

Hi,

we experienced an issue when trying to resume an asynchronous response in our HTTP server. The issue was caused by an NPE that was thrown when trying to close the OutputBuffer:

java.lang.NullPointerException: Cannot invoke "org.glassfish.grizzly.http.HttpContext.getOutputSink()" because "this.httpContext" is null
        at org.glassfish.grizzly.http.io.OutputBuffer.blockAfterWriteIfNeeded(OutputBuffer.java:906)
        at org.glassfish.grizzly.http.io.OutputBuffer.close(OutputBuffer.java:684)
        at org.glassfish.grizzly.http.server.NIOOutputStreamImpl.close(NIOOutputStreamImpl.java:76)
        at org.glassfish.jersey.message.internal.CommittingOutputStream.close(CommittingOutputStream.java:251)
        at org.glassfish.jersey.message.internal.OutboundMessageContext.close(OutboundMessageContext.java:565)
        at org.glassfish.jersey.server.ContainerResponse.close(ContainerResponse.java:403)
        at org.glassfish.jersey.server.ServerRuntime$Responder.writeResponse(ServerRuntime.java:763)
        at org.glassfish.jersey.server.ServerRuntime$Responder.processResponse(ServerRuntime.java:398)
        at org.glassfish.jersey.server.ServerRuntime$Responder.process(ServerRuntime.java:388)
        at org.glassfish.jersey.server.ServerRuntime$AsyncResponder$3.run(ServerRuntime.java:926)
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248)
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:244)
        at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:266)
        at org.glassfish.jersey.server.ServerRuntime$AsyncResponder.resume(ServerRuntime.java:963)
        at org.glassfish.jersey.server.ServerRuntime$AsyncResponder.resume(ServerRuntime.java:914)

We are using grizzly-http-server version 4.0.2.

This is the first time we saw such an issue although we are using this version for several months now.

Best regards,
Marcel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant