Seam application: java.util.zip.ZipException: error in opening zip file

Version 3

    I had a Seam application I was trying to migrate from AS 4.2 to 6 [this happened in 5 as well].  When I deployed the application, I kept getting the following error:

     

    Caused by: java.util.zip.ZipException: error in opening zip file

            at java.util.zip.ZipFile.open(Native Method) [:1.6.0_23]

            at java.util.zip.ZipFile.<init>(ZipFile.java:127) [:1.6.0_23]

            at java.util.zip.ZipFile.<init>(ZipFile.java:144) [:1.6.0_23]

            at org.jboss.seam.deployment.URLScanner.handleArchiveByFile(URLScanner.java:123) [:2.2.1.Final]

            ... 80 more

     

    The root issue is that there is a special Seam deployer bundled with JBoss ($JBOSS_HOME/server/*/deployers/seam.deployer), which is needed for deploying Seam applications.  If the deployer is not used, you'll get the above ZipException [not sure why this is...].

     

    In order to be called, the AS has to realize that an application is a Seam application.  It does this based on the following directory entries [see: http://grepcode.com/file/repository.jboss.org/nexus/content/repositories/releases/org.jboss.seam.integration/jboss-seam-int-microcontainer/5.0.0.CR5/org/jboss/seam/integration/microcontainer/deployers/SeamUrlIntegrationDeployer.java]:

     

    seam.properties

    META-INF/seam.properties

    WEB-INF/classes/seam.properties

    META-INF/components.xml

    WEB-INF/classes/META-INF/components.xml

     

    If it does *not* find one of those files, the Seam deployer is *not* called and the application will not deploy correctly. 

     

    My application happened to have those files bundled in a jar in the WEB-INF/lib directory.  The application ran fine on AS 4.2 (and with JBoss tools).  However, AS 6 was not able to determine that the application was a Seam application and was thus unable to properly deploy it.

     

    I solved the problem by adding one of the above files to the *war* file.  Once I did this, AS 6 properly deployed the app.

     

    The issue can also be solved by bundling the jboss-seam-int-jbossas.jar in the WEB-INF/lib directory of the war.

     

    [Original discussion: http://community.jboss.org/thread/164591]