我有一个 Spring 3 + maven + JSF 2.0 + primefaces 项目。当我部署到 Jboss 7.1.1 并在 Eclipse 中运行服务器时,在启动过程中会显示很多警告消息,如下所示:
12:24:28,262 WARN [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015852: Could not index class com/sun/faces/context/FacesContextImpl$ComponentMessagesIterator.class at /Users/bonski/Google Drive/MyProject/server/jboss-as-7.1.1.Final/standalone/deployments/SportPack.war/WEB-INF/lib/jsf-impl-2.1.6.jar: java.util.zip.ZipException: invalid LOC header (bad signature)
at java.util.zip.ZipFile.read(Native Method) [classes.jar:1.6.0_37]
at java.util.zip.ZipFile.access$1200(ZipFile.java:31) [classes.jar:1.6.0_37]
at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:459) [classes.jar:1.6.0_37]
at java.util.zip.ZipFile$1.fill(ZipFile.java:242) [classes.jar:1.6.0_37]
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:141) [classes.jar:1.6.0_37]
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) [classes.jar:1.6.0_37]
at java.io.BufferedInputStream.read1(BufferedInputStream.java:258) [classes.jar:1.6.0_37]
at java.io.BufferedInputStream.read(BufferedInputStream.java:317) [classes.jar:1.6.0_37]
at java.io.DataInputStream.readFully(DataInputStream.java:178) [classes.jar:1.6.0_37]
at java.io.DataInputStream.readFully(DataInputStream.java:152) [classes.jar:1.6.0_37]
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.1.Final.jar:7.1.1.Final]
at org.jboss.as.server.deployment.annotation.AnnotationIndexProcessor.deploy(AnnotationIndexProcessor.java:51) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [classes.jar:1.6.0_37]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [classes.jar:1.6.0_37]
at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_37]
最后我有以下错误:
12:24:28,943 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.unit."SportPack.war".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."SportPack.war".STRUCTURE: Failed to process phase STRUCTURE of deployment "SportPack.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [classes.jar:1.6.0_37]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [classes.jar:1.6.0_37]
at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_37] Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Failed to get manifest for deployment "/Users/bonski/Google Drive/MyProject/server/jboss-as-7.1.1.Final/standalone/deployments/SportPack.war/WEB-INF/lib/jsf-impl-2.1.6.jar"
at org.jboss.as.server.deployment.module.ManifestAttachmentProcessor.deploy(ManifestAttachmentProcessor.java:73) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
... 5 more
Caused by: java.util.zip.ZipException: invalid LOC header (bad signature)
at java.util.zip.ZipFile.read(Native Method) [classes.jar:1.6.0_37]
at java.util.zip.ZipFile.access$1200(ZipFile.java:31) [classes.jar:1.6.0_37]
at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:459) [classes.jar:1.6.0_37]
at java.util.zip.ZipFile$1.fill(ZipFile.java:242) [classes.jar:1.6.0_37]
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:141) [classes.jar:1.6.0_37]
at java.util.jar.Manifest$FastInputStream.fill(Manifest.java:422) [classes.jar:1.6.0_37]
at java.util.jar.Manifest$FastInputStream.readLine(Manifest.java:356) [classes.jar:1.6.0_37]
at java.util.jar.Manifest$FastInputStream.readLine(Manifest.java:390) [classes.jar:1.6.0_37]
at java.util.jar.Attributes.read(Attributes.java:359) [classes.jar:1.6.0_37]
at java.util.jar.Manifest.read(Manifest.java:180) [classes.jar:1.6.0_37]
at java.util.jar.Manifest.<init>(Manifest.java:50) [classes.jar:1.6.0_37]
at org.jboss.vfs.VFSUtils.readManifest(VFSUtils.java:216)
at org.jboss.vfs.VFSUtils.getManifest(VFSUtils.java:199)
at org.jboss.as.server.deployment.module.ManifestAttachmentProcessor.deploy(ManifestAttachmentProcessor.java:69) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
... 6 more
这是我的 pom.xml 文件
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sportPack.app</groupId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>sp</name>
<url>http://maven.apache.org</url>
<repositories>
<repository>
<id>prime-repo</id>
<name>PrimeFaces Maven Repository</name>
<url>http://repository.primefaces.org</url>
<layout>default</layout>
</repository>
</repositories>
<properties>
<spring.version>3.1.1.RELEASE</spring.version>
<hibernate.version>3.5.1-Final</hibernate.version>
</properties>
<dependencies>
<!-- Spring 3 dependencies -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- JSF library -->
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.1.6</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.1.6</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- Primefaces library -->
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>3.1.1</version>
</dependency>
<!-- Hibernate library -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>3.5.1-Final</version>
</dependency>
<!-- MySQL Java Connector library -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.17</version>
</dependency>
<dependency>
<groupId>c3p0</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.1.2</version>
</dependency>
<!-- Log4j library -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.4</version>
</dependency>
</dependencies>
<artifactId>sp</artifactId>
.