我正在使用从GlassFish到WildFly的Mojarra 2.2.8迁移JSF项目。我正在使用Maven来管理依赖项,我没有在服务器文件夹中实际添加库。在WildFly上,我在部署期间得到以下异常。据我所知,不同的JSF实现之间存在冲突。
11:47:55,630 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-3) Unable to process annotations for url, vfs:/C:/utils/wildfly-8.0.0.Final/standalone/deployments/cursus-management.war/WEB-INF/lib/primefaces-5.0.jar/META-INF/faces-config.xml. Reason: java.util.zip.ZipException: zip file is empty
11:47:55,631 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-3) : java.util.zip.ZipException: zip file is empty
at java.util.zip.ZipFile.open(Native Method) [rt.jar:1.7.0_40]
at java.util.zip.ZipFile.<init>(ZipFile.java:215) [rt.jar:1.7.0_40]
at java.util.zip.ZipFile.<init>(ZipFile.java:145) [rt.jar:1.7.0_40]
at java.util.jar.JarFile.<init>(JarFile.java:153) [rt.jar:1.7.0_40]
at sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:88) [rt.jar:1.7.0_40]
at sun.net.www.protocol.jar.URLJarFile$1.run(URLJarFile.java:221) [rt.jar:1.7.0_40]
at sun.net.www.protocol.jar.URLJarFile$1.run(URLJarFile.java:216) [rt.jar:1.7.0_40]
at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.7.0_40]
at sun.net.www.protocol.jar.URLJarFile.retrieve(URLJarFile.java:215) [rt.jar:1.7.0_40]
at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:71) [rt.jar:1.7.0_40]
at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:109) [rt.jar:1.7.0_40]
at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:122) [rt.jar:1.7.0_40]
at sun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:89) [rt.jar:1.7.0_40]
at com.sun.faces.config.JavaClassScanningAnnotationScanner.processClasspath(JavaClassScanningAnnotationScanner.java:166) [jsf-impl-2.2.8.jar:2.2.8]
at com.sun.faces.config.JavaClassScanningAnnotationScanner.getAnnotatedClasses(JavaClassScanningAnnotationScanner.java:125) [jsf-impl-2.2.8.jar:2.2.8]
at com.sun.faces.config.DelegatingAnnotationProvider.getAnnotatedClasses(DelegatingAnnotationProvider.java:85) [jsf-impl-2.2.8.jar:2.2.8]
at com.sun.faces.config.ConfigManager$AnnotationScanTask.call(ConfigManager.java:932) [jsf-impl-2.2.8.jar:2.2.8]
at com.sun.faces.config.ConfigManager$AnnotationScanTask.call(ConfigManager.java:884) [jsf-impl-2.2.8.jar:2.2.8]
at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_40]
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:383) [jsf-impl-2.2.8.jar:2.2.8]
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:221) [jsf-impl-2.2.8.jar:2.2.8]
at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:173) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:187) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:86)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.start(UndertowDeploymentService.java:71)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_40]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_40]
at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]
11:47:55,635 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-3) Unable to process annotations for url, vfs:/C:/utils/wildfly-8.0.0.Final/standalone/deployments/cursus-management.war/WEB-INF/lib/omnifaces-1.8.1.jar/META-INF/faces-config.xml. Reason: java.util.zip.ZipException: zip file is empty
11:47:55,635 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-3) : java.util.zip.ZipException: zip file is empty
at java.util.zip.ZipFile.open(Native Method) [rt.jar:1.7.0_40]
at java.util.zip.ZipFile.<init>(ZipFile.java:215) [rt.jar:1.7.0_40]
at java.util.zip.ZipFile.<init>(ZipFile.java:145) [rt.jar:1.7.0_40]
at java.util.jar.JarFile.<init>(JarFile.java:153) [rt.jar:1.7.0_40]
at sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:88) [rt.jar:1.7.0_40]
at sun.net.www.protocol.jar.URLJarFile$1.run(URLJarFile.java:221) [rt.jar:1.7.0_40]
at sun.net.www.protocol.jar.URLJarFile$1.run(URLJarFile.java:216) [rt.jar:1.7.0_40]
at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.7.0_40]
at sun.net.www.protocol.jar.URLJarFile.retrieve(URLJarFile.java:215) [rt.jar:1.7.0_40]
at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:71) [rt.jar:1.7.0_40]
at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:109) [rt.jar:1.7.0_40]
at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:122) [rt.jar:1.7.0_40]
at sun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:89) [rt.jar:1.7.0_40]
at com.sun.faces.config.JavaClassScanningAnnotationScanner.processClasspath(JavaClassScanningAnnotationScanner.java:166) [jsf-impl-2.2.8.jar:2.2.8]
at com.sun.faces.config.JavaClassScanningAnnotationScanner.getAnnotatedClasses(JavaClassScanningAnnotationScanner.java:125) [jsf-impl-2.2.8.jar:2.2.8]
at com.sun.faces.config.DelegatingAnnotationProvider.getAnnotatedClasses(DelegatingAnnotationProvider.java:85) [jsf-impl-2.2.8.jar:2.2.8]
at com.sun.faces.config.ConfigManager$AnnotationScanTask.call(ConfigManager.java:932) [jsf-impl-2.2.8.jar:2.2.8]
at com.sun.faces.config.ConfigManager$AnnotationScanTask.call(ConfigManager.java:884) [jsf-impl-2.2.8.jar:2.2.8]
at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_40]
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:383) [jsf-impl-2.2.8.jar:2.2.8]
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:221) [jsf-impl-2.2.8.jar:2.2.8]
at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:173) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:187) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:86)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.start(UndertowDeploymentService.java:71)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_40]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_40]
at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]
11:47:55,639 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-3) Unable to process annotations for url, vfs:/C:/utils/wildfly-8.0.0.Final/standalone/deployments/cursus-management.war/WEB-INF/lib/prettyfaces-jsf2-3.3.3.jar/META-INF/faces-config.xml. Reason: java.util.zip.ZipException: zip file is empty
11:47:55,639 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-3) : java.util.zip.ZipException: zip file is empty
at java.util.zip.ZipFile.open(Native Method) [rt.jar:1.7.0_40]
at java.util.zip.ZipFile.<init>(ZipFile.java:215) [rt.jar:1.7.0_40]
at java.util.zip.ZipFile.<init>(ZipFile.java:145) [rt.jar:1.7.0_40]
at java.util.jar.JarFile.<init>(JarFile.java:153) [rt.jar:1.7.0_40]
at sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:88) [rt.jar:1.7.0_40]
at sun.net.www.protocol.jar.URLJarFile$1.run(URLJarFile.java:221) [rt.jar:1.7.0_40]
at sun.net.www.protocol.jar.URLJarFile$1.run(URLJarFile.java:216) [rt.jar:1.7.0_40]
at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.7.0_40]
at sun.net.www.protocol.jar.URLJarFile.retrieve(URLJarFile.java:215) [rt.jar:1.7.0_40]
at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:71) [rt.jar:1.7.0_40]
at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:109) [rt.jar:1.7.0_40]
at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:122) [rt.jar:1.7.0_40]
at sun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:89) [rt.jar:1.7.0_40]
at com.sun.faces.config.JavaClassScanningAnnotationScanner.processClasspath(JavaClassScanningAnnotationScanner.java:166) [jsf-impl-2.2.8.jar:2.2.8]
at com.sun.faces.config.JavaClassScanningAnnotationScanner.getAnnotatedClasses(JavaClassScanningAnnotationScanner.java:125) [jsf-impl-2.2.8.jar:2.2.8]
at com.sun.faces.config.DelegatingAnnotationProvider.getAnnotatedClasses(DelegatingAnnotationProvider.java:85) [jsf-impl-2.2.8.jar:2.2.8]
at com.sun.faces.config.ConfigManager$AnnotationScanTask.call(ConfigManager.java:932) [jsf-impl-2.2.8.jar:2.2.8]
at com.sun.faces.config.ConfigManager$AnnotationScanTask.call(ConfigManager.java:884) [jsf-impl-2.2.8.jar:2.2.8]
at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_40]
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:383) [jsf-impl-2.2.8.jar:2.2.8]
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:221) [jsf-impl-2.2.8.jar:2.2.8]
at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:173) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:187) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:86)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.start(UndertowDeploymentService.java:71)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_40]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_40]
at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]
11:47:56,759 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-3) Critical error during deployment: : com.sun.faces.config.ConfigurationException: The tag named passThroughAttribute from namespace http://xmlns.jcp.org/jsf/core has a null handler-class defined
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processHandlerClass(FaceletTaglibConfigProcessor.java:422) [jsf-impl-2.2.8.jar:2.2.8]
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processTags(FaceletTaglibConfigProcessor.java:378) [jsf-impl-2.2.8.jar:2.2.8]
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processTagLibrary(FaceletTaglibConfigProcessor.java:321) [jsf-impl-2.2.8.jar:2.2.8]
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.process(FaceletTaglibConfigProcessor.java:270) [jsf-impl-2.2.8.jar:2.2.8]
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:437) [jsf-impl-2.2.8.jar:2.2.8]
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:221) [jsf-impl-2.2.8.jar:2.2.8]
at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:173) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:187) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:86)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.start(UndertowDeploymentService.java:71)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_40]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_40]
at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]
11:47:56,760 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./cursus-management: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./cursus-management: Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_40]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_40]
at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: The tag named passThroughAttribute from namespace http://xmlns.jcp.org/jsf/core has a null handler-class defined
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:216)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:86)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.start(UndertowDeploymentService.java:71)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]
... 3 more
Caused by: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: The tag named passThroughAttribute from namespace http://xmlns.jcp.org/jsf/core has a null handler-class defined
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:280)
at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:173)
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:187)
... 7 more
Caused by: com.sun.faces.config.ConfigurationException: The tag named passThroughAttribute from namespace http://xmlns.jcp.org/jsf/core has a null handler-class defined
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processHandlerClass(FaceletTaglibConfigProcessor.java:422)
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processTags(FaceletTaglibConfigProcessor.java:378)
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processTagLibrary(FaceletTaglibConfigProcessor.java:321)
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.process(FaceletTaglibConfigProcessor.java:270)
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:437)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:221)
... 9 more
11:47:56,767 ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 2) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "cursus-management.war")]) - failure description: {"JBAS014671: Failed services" => {"jboss.undertow.deployment.default-server.default-host./cursus-management" => "org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./cursus-management: Failed to start service
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: The tag named passThroughAttribute from namespace http://xmlns.jcp.org/jsf/core has a null handler-class defined
Caused by: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: The tag named passThroughAttribute from namespace http://xmlns.jcp.org/jsf/core has a null handler-class defined
Caused by: com.sun.faces.config.ConfigurationException: The tag named passThroughAttribute from namespace http://xmlns.jcp.org/jsf/core has a null handler-class defined"}}
11:47:57,205 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "cursus-management.war" (runtime-name : "cursus-management.war")
11:47:57,206 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.undertow.deployment.default-server.default-host./cursus-management: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./cursus-management: Failed to start service
的pom.xml:
<repositories>
<repository>
<id>prime-repo</id>
<name>PrimeFaces Maven Repository</name>
<url>http://repository.primefaces.org</url>
<layout>default</layout>
</repository>
</repositories>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java-version>1.7</java-version>
<jsf-version>2.2.8</jsf-version>
<org.springframework.version>4.1.1.RELEASE</org.springframework.version>
<spring-security.version>3.2.5.RELEASE</spring-security.version>
<org.slf4j.version>1.7.7</org.slf4j.version>
<org.apache.cxf.version>3.0.2</org.apache.cxf.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<!-- JSF -->
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>${jsf-version}</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>${jsf-version}</version>
</dependency>
<!-- omnifaces -->
<dependency>
<groupId>org.omnifaces</groupId>
<artifactId>omnifaces</artifactId>
<version>1.8.1</version>
</dependency>
<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- EL -->
<dependency>
<groupId>javax.el</groupId>
<artifactId>javax.el-api</artifactId>
<version>3.0.0</version>
</dependency>
<!-- <dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>javax.el</artifactId>
<version>2.2.6</version>
</dependency> -->
<!-- PrimeFaces -->
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>5.0</version>
</dependency>
<dependency>
<groupId>org.primefaces.themes</groupId>
<artifactId>all-themes</artifactId>
<version>1.0.10</version>
</dependency>
<!-- PrettyFaces -->
<dependency>
<groupId>com.ocpsoft</groupId>
<artifactId>prettyfaces-jsf2</artifactId>
<version>3.3.3</version>
</dependency>
<!-- Spring Core -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${org.springframework.version}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework.version}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<!-- Spring Security -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>${spring-security.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>${spring-security.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>${spring-security.version}</version>
</dependency>
<!-- AspectJ -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.8.2</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<version>1.8.2</version>
</dependency>
<!-- SLF4J -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${org.slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
<version>${org.slf4j.version}</version>
</dependency>
<!-- Log Back -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2</version>
</dependency>
<!-- CXF -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${org.apache.cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${org.apache.cxf.version}</version>
</dependency>
</dependencies>
<build>
<finalName>cursus-management</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${java-version}</source>
<target>${java-version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.2</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
答案 0 :(得分:6)
据我所知,不同的JSF实现之间存在冲突
当运行时类路径中存在多个不同版本的JSF API类时,这种问题确实很典型。
在您的特定情况下,您要告诉Maven在WAR /WEB-INF/lib
中捆绑JSF(以及其他Java EE相关工件!)库。这个不对。当针对符合Java EE的服务器(读取:不是Tomcat)时,这些库(JSF,Servlet,JSTL,EL等)应该由目标服务器本身已经提供。所以你应该把它们放到Maven的<provided>
范围内。
您最好取代以下
<properties>
...
<jsf-version>2.2.8</jsf-version>
...
</properties>
<!-- JSF -->
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>${jsf-version}</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>${jsf-version}</version>
</dependency>
<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- EL -->
<dependency>
<groupId>javax.el</groupId>
<artifactId>javax.el-api</artifactId>
<version>3.0.0</version>
</dependency>
<!-- <dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>javax.el</artifactId>
<version>2.2.6</version>
</dependency> -->
通过
<properties>
...
<javaee-version>7.0</javaee-version>
...
</properties>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>${javaee.version}</version>
<scope>provided</scope>
</dependency>
如果您想在WildFly中单独升级JSF版本,请转到此答案:Upgrade JSF / Mojarra in JBoss AS / EAP / WildFly。
它在GlassFish中有效可能是因为声明的版本恰好与GlassFish提供的版本完全匹配(但是在运行时期间,您仍有可能在Java EE相关类上遇到无法解释的ClassCastExceptions
。
答案 1 :(得分:-1)
右键单击您的proyect并转到Properties-&gt; Project Facets-&gt; Java Server Faces并更改 来自:“Jsf 2.2(Mojarra 2.2.0)” 至“Jsf 2.0(Mojarra 2.0.3-FCS)”