1 Reply Latest reply on Jan 30, 2012 8:34 AM by David Bailey

    ZipException when deploying: invalid CEN header (bad compression method)

    David Bailey Newbie

      I'm using Maven to build an EAR file.  When I copy the EAR into my JBoss 'server\default\deploy' directory, the deployment fails with a ZipException.  I'm running JBoss 5.1.0GA on a Windows XP 32-bit system.

       

      Here is the relevant portion of my Maven pom.xml:

       

      {code:xml}

        <dependencies>

            <dependency>

              <groupId>org.jboss.ejb3</groupId>

              <artifactId>jboss-ejb3-api</artifactId>

              <version>3.1.0</version>

              <scope>provided</scope>

          </dependency>

          <dependency>

              <groupId>net.sf.ehcache</groupId>

              <artifactId>ehcache-core</artifactId>

              <version>2.4.1</version>

              <exclusions>

                  <exclusion>

                      <groupId>org.slf4j</groupId>

                      <artifactId>slf4j-api</artifactId>

                  </exclusion>

                  <exclusion>

                      <groupId>org.slf4j</groupId>

                      <artifactId>slf4j-jdk14</artifactId>

                  </exclusion>

              </exclusions>

          </dependency>

          <dependency>

              <groupId>org.slf4j</groupId>

              <artifactId>slf4j-api</artifactId>

              <version>1.5.8</version>

              <type>jar</type>

              <scope>provided</scope>

          </dependency>

          <dependency>

              <groupId>commons-lang</groupId>

              <artifactId>commons-lang</artifactId>

              <version>2.5</version>

              <scope>provided</scope>

          </dependency>

        </dependencies>

      {code}

       

      FWIW, the problem appeared after I added the references to ehcache, slf4j and commons-lang.  However, I think it's likely that the jar files for those dependencies are all valid, because my web search didn't turn up anyone else having complaints about these files.  So perhaps Maven is producing a bad EAR file?  I'm using Maven 2.2.1.

       

      Finally, here is the stack trace produced by JBoss:

       

      16:14:37,854 ERROR [AbstractKernelController] Error installing to ClassLoader: name=vfszip:/D:/Applications/jboss-5.1.0.GA/server/default/deploy/qlws-ear-SNAPSHOT-0.0.1.ear/ state=Describe mode=Manual requiredState=ClassLoader

      org.jboss.deployers.spi.DeploymentException: Error creating classloader for vfszip:/D:/Applications/jboss-5.1.0.GA/server/default/deploy/qlws-ear-SNAPSHOT-0.0.1.ear/

          at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)

          at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext.createClassLoader(AbstractDeploymentContext.java:579)

          at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentUnit.createClassLoader(AbstractDeploymentUnit.java:161)

          at org.jboss.deployers.spi.deployer.helpers.AbstractClassLoaderDeployer.deploy(AbstractClassLoaderDeployer.java:53)

          at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)

          at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)

          at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)

          at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)

          at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)

          at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)

          at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)

          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)

          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)

          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)

          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)

          at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)

          at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)

          at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)

          at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:362)

          at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)

          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)

          at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)

          at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)

          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)

          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)

          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

          at java.lang.Thread.run(Thread.java:662)

      Caused by: java.lang.Error: Error visiting DelegatingHandler@16482247[path=qlws-ear-SNAPSHOT-0.0.1.ear/qlws-ejb.jar context=file:/D:/Applications/jboss-5.1.0.GA/server/default/deploy/ real=file:/D:/Applications/jboss-5.1.0.GA/server/default/deploy/qlws-ear-SNAPSHOT-0.0.1.ear/qlws-ejb.jar]

          at org.jboss.classloading.plugins.vfs.PackageVisitor.determineAllPackages(PackageVisitor.java:98)

          at org.jboss.deployers.vfs.plugins.classloader.VFSDeploymentClassLoaderPolicyModule.determineCapabilities(VFSDeploymentClassLoaderPolicyModule.java:108)

          at org.jboss.classloading.spi.dependency.Module.getCapabilities(Module.java:654)

          at org.jboss.classloading.spi.dependency.Module.determinePackageNames(Module.java:716)

          at org.jboss.classloading.spi.dependency.Module.getPackageNames(Module.java:701)

          at org.jboss.deployers.vfs.plugins.classloader.VFSDeploymentClassLoaderPolicyModule.determinePolicy(VFSDeploymentClassLoaderPolicyModule.java:129)

          at org.jboss.deployers.vfs.plugins.classloader.VFSDeploymentClassLoaderPolicyModule.determinePolicy(VFSDeploymentClassLoaderPolicyModule.java:48)

          at org.jboss.classloading.spi.dependency.policy.ClassLoaderPolicyModule.getPolicy(ClassLoaderPolicyModule.java:195)

          at org.jboss.deployers.vfs.plugins.classloader.VFSDeploymentClassLoaderPolicyModule.getPolicy(VFSDeploymentClassLoaderPolicyModule.java:122)

          at org.jboss.deployers.vfs.plugins.classloader.VFSDeploymentClassLoaderPolicyModule.getPolicy(VFSDeploymentClassLoaderPolicyModule.java:48)

          at org.jboss.classloading.spi.dependency.policy.ClassLoaderPolicyModule.registerClassLoaderPolicy(ClassLoaderPolicyModule.java:131)

          at org.jboss.deployers.plugins.classloading.AbstractLevelClassLoaderSystemDeployer.createClassLoader(AbstractLevelClassLoaderSystemDeployer.java:120)

          at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext.createClassLoader(AbstractDeploymentContext.java:565)

          ... 27 more

      Caused by: java.lang.RuntimeException: java.util.zip.ZipException: invalid CEN header (bad compression method)

          at org.jboss.virtual.plugins.context.AbstractExceptionHandler.handleZipEntriesInitException(AbstractExceptionHandler.java:39)

          at org.jboss.virtual.plugins.context.helpers.NamesExceptionHandler.handleZipEntriesInitException(NamesExceptionHandler.java:63)

          at org.jboss.virtual.plugins.context.zip.ZipEntryContext.ensureEntries(ZipEntryContext.java:626)

          at org.jboss.virtual.plugins.context.zip.ZipEntryContext.checkIfModified(ZipEntryContext.java:773)

          at org.jboss.virtual.plugins.context.zip.ZipEntryContext.getChildren(ZipEntryContext.java:845)

          at org.jboss.virtual.plugins.context.zip.ZipEntryHandler.getChildren(ZipEntryHandler.java:159)

          at org.jboss.virtual.plugins.context.DelegatingHandler.getChildren(DelegatingHandler.java:121)

          at org.jboss.virtual.plugins.context.AbstractVFSContext.getChildren(AbstractVFSContext.java:219)

          at org.jboss.virtual.plugins.context.AbstractVFSContext.visit(AbstractVFSContext.java:336)

          at org.jboss.virtual.plugins.context.AbstractVFSContext.visit(AbstractVFSContext.java:306)

          at org.jboss.virtual.VFS.visit(VFS.java:421)

          at org.jboss.virtual.VirtualFile.visit(VirtualFile.java:437)

          at org.jboss.virtual.VirtualFile.getChildren(VirtualFile.java:386)

          at org.jboss.virtual.VirtualFile.getChildren(VirtualFile.java:367)

          at org.jboss.classloading.plugins.vfs.PackageVisitor.visit(PackageVisitor.java:200)

          at org.jboss.virtual.plugins.vfs.helpers.WrappingVirtualFileHandlerVisitor.visit(WrappingVirtualFileHandlerVisitor.java:62)

          at org.jboss.virtual.plugins.context.AbstractVFSContext.visit(AbstractVFSContext.java:361)

          at org.jboss.virtual.plugins.context.AbstractVFSContext.visit(AbstractVFSContext.java:306)

          at org.jboss.virtual.VFS.visit(VFS.java:421)

          at org.jboss.virtual.VirtualFile.visit(VirtualFile.java:437)

          at org.jboss.classloading.plugins.vfs.PackageVisitor.determineAllPackages(PackageVisitor.java:94)

          ... 39 more

      Caused by: java.util.zip.ZipException: invalid CEN header (bad compression method)

          at java.util.zip.ZipFile.open(Native Method)

          at java.util.zip.ZipFile.<init>(ZipFile.java:127)

          at java.util.zip.ZipFile.<init>(ZipFile.java:144)

          at org.jboss.virtual.plugins.context.zip.ZipFileWrapper.ensureZipFile(ZipFileWrapper.java:175)

          at org.jboss.virtual.plugins.context.zip.ZipFileWrapper.acquire(ZipFileWrapper.java:245)

          at org.jboss.virtual.plugins.context.zip.ZipEntryContext.initEntries(ZipEntryContext.java:484)

          at org.jboss.virtual.plugins.context.zip.ZipEntryContext.ensureEntries(ZipEntryContext.java:619)

          ... 57 more

      16:14:38,011 WARN  [HDScanner] Failed to process changes

      org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

       

      *** DEPLOYMENTS IN ERROR: Name -> Error

       

      vfszip:/D:/Applications/jboss-5.1.0.GA/server/default/deploy/qlws-ear-SNAPSHOT-0.0.1.ear/ -> org.jboss.deployers.spi.DeploymentException: Error creating classloader for vfszip:/D:/Applications/jboss-5.1.0.GA/server/default/deploy/qlws-ear-SNAPSHOT-0.0.1.ear/

       

       

      DEPLOYMENTS IN ERROR:

        Deployment "vfszip:/D:/Applications/jboss-5.1.0.GA/server/default/deploy/qlws-ear-SNAPSHOT-0.0.1.ear/" is in error due to the following reason(s): java.util.zip.ZipException: invalid CEN header (bad compression method)

       

          at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:993)

          at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:939)

          at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:873)

          at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.checkComplete(MainDeployerAdapter.java:128)

          at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:369)

          at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)

          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)

          at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)

          at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)

          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)

          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)

          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

          at java.lang.Thread.run(Thread.java:662)