Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm getting some error with some connection to our web server. We are getting this error randomly:

java.lang.IllegalStateException: zip file closed
    at java.util.jar.JarFile$1.hasMoreElements(
    at org.eclipse.jetty.util.resource.JarFileResource.exists(
    at org.eclipse.jetty.webapp.WebAppContext$Context.getResource(
    at org.eclipse.jetty.servlet.DefaultServlet.getResource(
    at org.eclipse.jetty.server.ResourceCache.lookup(
    at org.eclipse.jetty.servlet.DefaultServlet.doGet(
    at javax.servlet.http.HttpServlet.service(
    at javax.servlet.http.HttpServlet.service(
    at org.eclipse.jetty.servlet.ServletHolder.handle(
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(
    at org.eclipse.jetty.servlet.ServletHandler.doScope(
    at org.eclipse.jetty.server.session.SessionHandler.doScope(
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(
    at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(
    at org.eclipse.jetty.server.Server.handle(
    at org.eclipse.jetty.server.HttpConnection.handleRequest(
    at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(
    at org.eclipse.jetty.http.HttpParser.parseNext(
    at org.eclipse.jetty.http.HttpParser.parseAvailable(
    at org.eclipse.jetty.server.AsyncHttpConnection.handle(
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(
    at org.eclipse.jetty.util.thread.QueuedThreadPool$

I saw that a bug causing this was solved in Jetty 7.6. Yes we get this error on our application running under Jetty 7.5.4 but we also get this with another apps running on a newer version 9.

Do you have any idea what this can be?

share|improve this question

You have a bad jar file.

The code that accesses org.eclipse.jetty.util.resource.JarFileResource.exists() is trying to validate that some requested content exists. It opened the jar file and attempted to find the Jar file entry for the requested resource, but failed to find it in the specific jar file as that jar file was corrupt. (it then proceeded to check the other jar files in the WebApp classloader)

Jetty 7.6 cannot fix this kind of error.

However, starting with Jetty 9.1.RC1, the error is a bit more useful and should report errors in jar files with more detail.

share|improve this answer
And why disabling gzip make the problem disappear? That seems to avoid this error after I've did so. – Alex J. Nov 12 '13 at 21:02
You might be seeing 2 different stacktraces. I can only respond about the one you pasted. (The other stacktrace would likely include references to the GzipFilter, GzipHandler, GzipStream, or IncludableGzipFilter) – joakime Nov 12 '13 at 21:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.