0.8.0-rc3 IllegalStateException on 2nd PUT returning 400
See original GitHub issueAfter upgrading from 0.7.1 to 0.8.0-rc3 i get an IllegalStateException. The first put works (returning 400). The second put throws an exception; the client (curl) hangs.
curl:
curl -XPUT http://localhost:8000/1/q/w -d hello
log:
127.0.0.1 - - [23/Feb/2015:14:51:44 +0000] "PUT /1/q/w HTTP/1.1" 400 23 "-" "curl/7.37.1" 72
ERROR [2015-02-23 14:51:45,829] org.glassfish.jersey.server.ServerRuntime$Responder: An I/O error has occurred while writing a response message entity to the container output stream.
! java.lang.IllegalStateException: The output stream has already been closed.
! at org.glassfish.jersey.message.internal.CommittingOutputStream.setStreamProvider(CommittingOutputStream.java:147) ~[app.jar:1.13.3-SNAPSHOT]
! at org.glassfish.jersey.message.internal.OutboundMessageContext.setStreamProvider(OutboundMessageContext.java:803) ~[app.jar:1.13.3-SNAPSHOT]
! at org.glassfish.jersey.server.ContainerResponse.setStreamProvider(ContainerResponse.java:372) ~[app.jar:1.13.3-SNAPSHOT]
! at org.glassfish.jersey.server.ServerRuntime$Responder.writeResponse(ServerRuntime.java:647) [app.jar:1.13.3-SNAPSHOT]
! at org.glassfish.jersey.server.ServerRuntime$Responder.processResponse(ServerRuntime.java:418) [app.jar:1.13.3-SNAPSHOT]
! at org.glassfish.jersey.server.ServerRuntime$Responder.process(ServerRuntime.java:408) [app.jar:1.13.3-SNAPSHOT]
! at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:306) [app.jar:1.13.3-SNAPSHOT]
! at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) [app.jar:1.13.3-SNAPSHOT]
! at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) [app.jar:1.13.3-SNAPSHOT]
! at org.glassfish.jersey.internal.Errors.process(Errors.java:315) [app.jar:1.13.3-SNAPSHOT]
! at org.glassfish.jersey.internal.Errors.process(Errors.java:297) [app.jar:1.13.3-SNAPSHOT]
! at org.glassfish.jersey.internal.Errors.process(Errors.java:267) [app.jar:1.13.3-SNAPSHOT]
! at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) [app.jar:1.13.3-SNAPSHOT]
! at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:286) [app.jar:1.13.3-SNAPSHOT]
! at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1072) [app.jar:1.13.3-SNAPSHOT]
! at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:399) [app.jar:1.13.3-SNAPSHOT]
! at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:381) [app.jar:1.13.3-SNAPSHOT]
! at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:344) [app.jar:1.13.3-SNAPSHOT]
! at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:221) [app.jar:1.13.3-SNAPSHOT]
! at io.dropwizard.jetty.NonblockingServletHolder.handle(NonblockingServletHolder.java:49) [app.jar:1.13.3-SNAPSHOT]
! at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669) [app.jar:1.13.3-SNAPSHOT]
! at org.eclipse.jetty.servlets.UserAgentFilter.doFilter(UserAgentFilter.java:83) [app.jar:1.13.3-SNAPSHOT]
! at org.eclipse.jetty.servlets.GzipFilter.doFilter(GzipFilter.java:300) [app.jar:1.13.3-SNAPSHOT]
! at io.dropwizard.jetty.BiDiGzipFilter.doFilter(BiDiGzipFilter.java:134) [app.jar:1.13.3-SNAPSHOT]
! at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) [app.jar:1.13.3-SNAPSHOT]
! at io.dropwizard.servlets.ThreadNameFilter.doFilter(ThreadNameFilter.java:29) [app.jar:1.13.3-SNAPSHOT]
! at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) [app.jar:1.13.3-SNAPSHOT]
! at io.dropwizard.jersey.filter.AllowedMethodsFilter.handle(AllowedMethodsFilter.java:44) [app.jar:1.13.3-SNAPSHOT]
! at io.dropwizard.jersey.filter.AllowedMethodsFilter.doFilter(AllowedMethodsFilter.java:39) [app.jar:1.13.3-SNAPSHOT]
! at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) [app.jar:1.13.3-SNAPSHOT]
! at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585) [app.jar:1.13.3-SNAPSHOT]
! at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127) [app.jar:1.13.3-SNAPSHOT]
! at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515) [app.jar:1.13.3-SNAPSHOT]
! at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061) [app.jar:1.13.3-SNAPSHOT]
! at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [app.jar:1.13.3-SNAPSHOT]
! at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) [app.jar:1.13.3-SNAPSHOT]
! at com.codahale.metrics.jetty9.InstrumentedHandler.handle(InstrumentedHandler.java:190) [app.jar:1.13.3-SNAPSHOT]
! at io.dropwizard.jetty.RoutingHandler.handle(RoutingHandler.java:51) [app.jar:1.13.3-SNAPSHOT]
! at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) [app.jar:1.13.3-SNAPSHOT]
! at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:95) [app.jar:1.13.3-SNAPSHOT]
! at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) [app.jar:1.13.3-SNAPSHOT]
! at org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:159) [app.jar:1.13.3-SNAPSHOT]
! at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) [app.jar:1.13.3-SNAPSHOT]
! at org.eclipse.jetty.server.Server.handle(Server.java:497) [app.jar:1.13.3-SNAPSHOT]
! at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310) [app.jar:1.13.3-SNAPSHOT]
! at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:245) [app.jar:1.13.3-SNAPSHOT]
! at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540) [app.jar:1.13.3-SNAPSHOT]
! at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635) [app.jar:1.13.3-SNAPSHOT]
! at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555) [app.jar:1.13.3-SNAPSHOT]
! at java.lang.Thread.run(Thread.java:745) [na:1.8.0_20]
Issue Analytics
- State:
- Created 9 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Spring REST using Jackson - 400 bad request logging
When I add the above to my code, I get this error: java.lang.IllegalStateException: Ambiguous @ExceptionHandler method mapped for [class org.springframework.
Read more >400 Bad Request - HTTP - MDN Web Docs
The HyperText Transfer Protocol (HTTP) 400 Bad Request response status code indicates that the server cannot or will not process the request ...
Read more >How to Fix a 400 Bad Request Error (Causes and Fixes) - Kinsta
Specifically, a 400 status code could indicate a general problem with the server, a server glitch, or other unspecified temporary issues.
Read more >Response status code does not indicate success: 400 (Bad ...
The remote server returned an error: (400) Bad Request. Description: An unhandled exception occurred during the execution of the current web ...
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 Free
Top 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

You shouldn’t reuse the
Responseobject in your implementation. Please try to create a newResponseobject in theput()method.Ran into the same issue. Got fixed when I stopped reusing Response object.