my JSF web application gives a random error: "zip file closed" when accessing files (for example, images, css, js). It deploys on Jetty 7. It appears that some of these files are not loaded (some images are missing from the 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 launch it from the maven (7.x) plugin with the berth: run or jetty: run-war, then I get no errors. Moreover, access to the root path of the web context gives the error "zip file is closed" only when starting on a stand-alone pier, but such an error when starting from maven will connect, and then this is a 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 this could be?
source share