JBoss deployment throws 'java.util.zip.ZipException: error in opening zip file' on Linux?

Posted by Kaushalya on Stack Overflow See other posts from Stack Overflow or by Kaushalya
Published on 2010-04-10T14:19:22Z Indexed on 2010/04/10 14:23 UTC
Read the original article Hit count: 302

Filed under:
|
|
|
|

I thought of posting both the question and the answer for others' knowledge.

I deployed a large EAR (contained more than ~1024 jars/wars) on JBoss running with Java 6 on Linux, and the deployment process cried throwing the following exception:

java.lang.RuntimeException: java.util.zip.ZipException: error in opening zip file)
    at org.jboss.deployment.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:53)
    at org.jboss.deployment.MainDeployer.init(MainDeployer.java:901)
    at org.jboss.deployment.MainDeployer.init(MainDeployer.java:895)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:809)
    at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
....
Caused by: java.lang.RuntimeException: java.util.zip.ZipException: error in opening zip file
at org.jboss.util.file.JarArchiveBrowser.<init>(JarArchiveBrowser.java:74)
at org.jboss.util.file.FileProtocolArchiveBrowserFactory.create(FileProtocolArchiveBrowserFactory.java:48)
at org.jboss.util.file.ArchiveBrowser.getBrowser(ArchiveBrowser.java:57)
at org.jboss.ejb3.EJB3Deployer.hasEjbAnnotation(EJB3Deployer.java:213)
....

This was caused by the 'limit of number of open file descriptors' of Linux/Unix operating systems. The default is 1024.

You can check the default value using:

ulimit -n

To increase the number of open file descriptors (say to 2048):

ulimit -n 2048

Check the man page of ulimit for more details.

© Stack Overflow or respective owner

Related posts about java

Related posts about jboss