Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6721355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:19:14+00:00 2026-05-26T09:19:14+00:00

my JSF web app is giving randomly error: zip file closed when accessing files

  • 0

my JSF web app is giving randomly error: “zip file closed” when accessing files (like images, css, js). It is deployed on Jetty 7. It looks like some of those files are not loaded (some images are missing on a page).

java.lang.IllegalStateException: zip file closed
    at java.util.zip.ZipFile.ensureOpen(ZipFile.java:403)
    at java.util.zip.ZipFile.entries(ZipFile.java:298)
    at java.util.jar.JarFile.entries(JarFile.java:217)
    at org.eclipse.jetty.util.resource.JarFileResource.list(JarFileResource.java:261)
    at org.eclipse.jetty.util.resource.ResourceCollection.list(ResourceCollection.java:421)
    at org.eclipse.jetty.util.resource.Resource.getListHTML(Resource.java:509)
    at org.eclipse.jetty.servlet.DefaultServlet.sendDirectory(DefaultServlet.java:741)
    at org.eclipse.jetty.servlet.DefaultServlet.doGet(DefaultServlet.java:564)

When I run it from maven plugin (7.x) with jetty:run or jetty:run-war then I do not get any error.
What’s more, accessing root path of web context gives that “zip file closed” error only when running on standalone jetty, but no such error when running from maven pluging, then is those directory view.

My web.xml:

   <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>

pom.xml:

  ....
  <dependencies>
    <dependency>
        <groupId>com.sun.faces</groupId>
        <artifactId>jsf-api</artifactId>
        <version>2.1.3</version>
    </dependency>
    <dependency>
        <groupId>com.sun.faces</groupId>
        <artifactId>jsf-impl</artifactId>
        <version>2.1.3</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
    </dependency>
    <dependency>
        <groupId>taglibs</groupId>
        <artifactId>standard</artifactId>
        <version>1.1.2</version>
    </dependency>
</dependencies>
....
<plugin>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>jetty-maven-plugin</artifactId>
        <version>7.5.1.v20110908</version>

        <configuration>
            <scanIntervalSeconds>10</scanIntervalSeconds>
        </configuration>
        <dependencies>
            <dependency>
                <groupId>com.sun.faces</groupId>
                <artifactId>jsf-api</artifactId>
                <version>2.1.3</version>
            </dependency>
            <dependency>
                <groupId>com.sun.faces</groupId>
                <artifactId>jsf-impl</artifactId>
                <version>2.1.3</version>
            </dependency>                    
        </dependencies>
    </plugin>   

Any idea what could it be?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:19:15+00:00Added an answer on May 26, 2026 at 9:19 am

    Jetty looks for your resources in the jar files in WEB-INF/lib. When it searches jsf-impl.jar it is somehow closed, probably by a JSF request. Perhaps jsf does its own resource handling and messes about with the files itself.

    Anyway, the solution seems to be to move the jsf jars out of the war-file. Set your jsf dependency scope to provided so maven does not package them in the war file, and get them on the server, probably in the lib folder in jetty standalone.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I made a web-app using JSF, MySQL, and NetBeans(web-app template-design). Here's the error-trace I
I am having problem when running my simple JSF hello-world like web app. The
We're developing a Java web app that utilizes JSF (Richfaces through Seam) for its
I am using a JSF 2.0 to create a web app (purely jee6, without
Im working in a Web App with Java and JSF. I have a simple
I am working on a web app using JSF w/Seam. I want to be
I have a resources web app, which only has static content, such as images,
I'm creating a JSF/Facelets web app in Eclipse. I've configured my project to use
Good evening, In a test JSF 2.0 web app, I am trying to get
In a simple demo web app using JSF 2 and Ajax, there is a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.