0

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.zip.ZipFile.ensureOpen(ZipFile.java:632)
    at java.util.zip.ZipFile.access$200(ZipFile.java:56)
    at java.util.zip.ZipFile$1.hasMoreElements(ZipFile.java:485)
    at java.util.jar.JarFile$1.hasMoreElements(JarFile.java:239)
    at org.eclipse.jetty.util.resource.JarFileResource.exists(JarFileResource.java:163)
    at org.eclipse.jetty.webapp.WebAppContext$Context.getResource(WebAppContext.java:1223)
    at org.eclipse.jetty.servlet.DefaultServlet.getResource(DefaultServlet.java:366)
    at org.eclipse.jetty.server.ResourceCache.lookup(ResourceCache.java:188)
    at org.eclipse.jetty.servlet.DefaultServlet.doGet(DefaultServlet.java:445)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:547)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:480)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:483)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:941)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:409)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:875)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
    at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:219)
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
    at org.eclipse.jetty.server.Server.handle(Server.java:345)
    at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
    at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:919)
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:582)
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:218)
    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
    at java.lang.Thread.run(Thread.java:722)

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?

0

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.

2
  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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