3 Replies Latest reply on Jan 3, 2012 7:49 PM by Karsten Wutzke

    Deploying a Hibernate 3 webapp to JBoss AS 7.1.CR1 fails with "could not index class" (CGLIB)

    Karsten Wutzke Expert

      Hello,

       

      I'm trying to deploy an existing webapp to JBoss AS 7.1.CR1. It has the following dependencies (RichFaces 3.3.3, Seam 2.2.x, Hibernate 3.6.x):

       

      {code}<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

       

        ...

       

        <packaging>war</packaging>

        <name>Basketball Stats</name>

        <description/>

        <repositories>

          <repository>

            <id>jboss</id>

            <url>https://repository.jboss.org/nexus/content/groups/public-jboss/</url>

          </repository>

        </repositories>

        <build>

          <sourceDirectory>${basedir}/src/main/java</sourceDirectory>

          <outputDirectory>${basedir}/target/WEB-INF/classes</outputDirectory>

          <resources>

              <resource>

                  <directory>${basedir}/src/main/java</directory>

                  <excludes>

                      <exclude>**/*.java</exclude>

                  </excludes>

              </resource>

          </resources>

          <plugins>

            <plugin>

              <artifactId>maven-war-plugin</artifactId>

              <configuration>

                <warSourceDirectory>${basedir}/src/main/webapp</warSourceDirectory>

              </configuration>

            </plugin>

            <plugin>

              <artifactId>maven-compiler-plugin</artifactId>

              <configuration>

                <source>1.6</source>

                <target>1.6</target>

              </configuration>

            </plugin>

          </plugins>

        </build>

        <properties>

          <richfaces.version>3.3.3.Final</richfaces.version>

          <seam.version>2.2.1.Final</seam.version>

          <hibernate.version>3.6.5.Final</hibernate.version>

        </properties>

        <dependencies>

         

          <dependency>

            <groupId>commons-lang</groupId>

            <artifactId>commons-lang</artifactId>

            <version>2.6</version>

          </dependency>

         

          <dependency>

            <groupId>com.sun.facelets</groupId>

            <artifactId>jsf-facelets</artifactId>

            <version>1.1.15.B1</version>

          </dependency>

          <dependency>

            <groupId>jstl</groupId>

            <artifactId>jstl</artifactId>

            <version>1.2</version>

          </dependency>           

         

          <dependency>

            <groupId>org.richfaces.ui</groupId>

            <artifactId>richfaces-ui</artifactId>

              <version>${richfaces.version}</version>

          </dependency>

          <dependency>

            <groupId>org.richfaces.framework</groupId>

            <artifactId>richfaces-api</artifactId>

              <version>${richfaces.version}</version>

          </dependency>

          <dependency>

            <groupId>org.richfaces.framework</groupId>

            <artifactId>richfaces-impl</artifactId>

              <version>${richfaces.version}</version>

          </dependency>

         

          <dependency>

              <groupId>org.jboss.seam</groupId>

              <artifactId>jboss-seam</artifactId>

              <version>${seam.version}</version>

          </dependency>

          <dependency>

              <groupId>org.jboss.seam</groupId>

              <artifactId>jboss-seam-ui</artifactId>

              <version>${seam.version}</version>

          </dependency>

          <dependency>

              <groupId>org.jboss.seam</groupId>

              <artifactId>jboss-seam-remoting</artifactId>

              <version>${seam.version}</version>

          </dependency>

          <dependency>

            <groupId>com.google.gwt</groupId>

            <artifactId>gwt-servlet</artifactId>

            <version>2.4.0</version>

          </dependency>

         

          <dependency>

            <groupId>org.hibernate</groupId>

            <artifactId>hibernate-core</artifactId>

            <version>${hibernate.version}</version>

          </dependency>

          <dependency>

            <groupId>org.hibernate</groupId>

            <artifactId>hibernate-entitymanager</artifactId>

            <version>${hibernate.version}</version>

          </dependency>

          <dependency>

            <groupId>org.hibernate</groupId>

            <artifactId>hibernate-validator</artifactId>

            <version>3.1.0.GA</version>

          </dependency>

         

        </dependencies>

       

      </project>{code}

       

      When deploying the webapp I get an exception:

       

      {code}19:05:52,842 WARN  [org.jboss.as.deployment] (MSC service thread 1-2) JBAS015852: Could not index class net/sf/cglib/beans/BeanMapEmitter$2.class at /C:/dev/jboss7/standalone/deployments/bbstats.war/WEB-INF/lib/cglib-2.2.jar: java.util.zip.ZipException: invalid LOC header (bad signature)

          at java.util.zip.ZipFile.read(Native Method) [:1.7.0_02]

          at java.util.zip.ZipFile.access$1400(Unknown Source) [:1.7.0_02]

          at java.util.zip.ZipFile$ZipFileInputStream.read(Unknown Source) [:1.7.0_02]

          at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(Unknown Source) [:1.7.0_02]

          at java.util.zip.InflaterInputStream.read(Unknown Source) [:1.7.0_02]

          at java.io.BufferedInputStream.fill(Unknown Source) [:1.7.0_02]

          at java.io.BufferedInputStream.read1(Unknown Source) [:1.7.0_02]

          at java.io.BufferedInputStream.read(Unknown Source) [:1.7.0_02]

          at java.io.DataInputStream.readFully(Unknown Source) [:1.7.0_02]

          at java.io.DataInputStream.readFully(Unknown Source) [:1.7.0_02]

          at org.jboss.jandex.Indexer.verifyMagic(Indexer.java:387) [jandex-1.0.3.Final.jar:1.0.3.Final]

          at org.jboss.jandex.Indexer.index(Indexer.java:630) [jandex-1.0.3.Final.jar:1.0.3.Final]

          at org.jboss.as.server.deployment.annotation.ResourceRootIndexer.indexResourceRoot(ResourceRootIndexer.java:77) [jboss-as-server-7.1.0.CR1.jar:7.1.0.CR1]

          at org.jboss.as.server.deployment.annotation.AnnotationIndexProcessor.deploy(AnnotationIndexProcessor.java:58) [jboss-as-server-7.1.0.CR1.jar:7.1.0.CR1]

          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115) [jboss-as-server-7.1.0.CR1.jar:7.1.0.CR1]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]

          at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [:1.7.0_02]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [:1.7.0_02]

          at java.lang.Thread.run(Unknown Source) [:1.7.0_02]{code}

      I get dozens or even hundreds of these exceptions actually. The deployment process is then stopped.

       

      hibernate-entitymanager causes a dependency to CGLIB, but I have never seen anything like this before.

       

      Can anyone help? Why is this happening? How do you cure this?

       

      Karsten