NoClassDefFoundError: javax/faces/component/UIViewAction on TomEE startup
NoClassDefFoundError: javax/faces/component/UIViewAction on TomEE startup
我正在尝试将 Web 项目(WEB-INF/lib
中的所有 JAR)迁移到 Maven Web 项目(pom.xml
中的所有 JAR)。
此项目使用以下库:
- JSF 2.2
- PrimeFaces
- BootsFaces
- OmniFaces
它在 TomEE 上运行。
TomEE启动出现如下错误:
NoClassDefFoundError: javax/faces/component/UIViewAction
但是 JSF2 库是由 TomEE 在类路径上提供的。
这是我的 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.lb</groupId>
<artifactId>XXX</artifactId>
<version>0.0.1</version>
<packaging>war</packaging>
<name>XXX</name>
<description>Application XXX</description>
<url>http://XXX.fr</url>
<organization>
<name>XXX</name>
<url>http://XXX.fr</url>
</organization>
<inceptionYear>2016</inceptionYear>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<javase.version>1.7</javase.version>
<javaee.version>7.0</javaee.version>
</properties>
<developers>
<developer>
<id>XXX</id>
<name>YYY</name>
<email>ZZZ@gmail.com</email>
</developer>
</developers>
<build>
<directory>${basedir}/target/${project.artifactId}-${project.version}</directory>
<finalName>XXX</finalName>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.java</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${javase.version}</source>
<target>${javase.version}</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<webResources>
<resource>
<directory>${basedir}/src/main/webapp/WEB-INF</directory>
<filtering>true</filtering>
<targetPath>WEB-INF</targetPath>
</resource>
<resource>
<directory>${basedir}/src/main/resources</directory>
<filtering>true</filtering>
<targetPath>WEB-INF/resources</targetPath>
</resource>
</webResources>
<webXml>${basedir}/src/main/webapp/WEB-INF/web.xml</webXml>
<warSourceDirectory>${basedir}/src/main/webapp</warSourceDirectory>
<packagingExcludes>
**/*.java,
</packagingExcludes>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.6</version>
</dependency>
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>5.3</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.10</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>org.primefaces.themes</groupId>
<artifactId>bootstrap</artifactId>
<version>1.0.10</version>
</dependency>
<dependency>
<groupId>net.bootsfaces</groupId>
<artifactId>bootsfaces</artifactId>
<version>0.8.1</version>
</dependency>
<dependency>
<groupId>org.omnifaces</groupId>
<artifactId>omnifaces</artifactId>
<version>2.2</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>prime-repo</id>
<name>PrimeFaces Maven Repository</name>
<url>http://repository.primefaces.org</url>
<layout>default</layout>
</repository>
</repositories>
感谢您的帮助。
class javax/faces/component/UIViewAction
是自 JSF 2.2 以来新增的。因此,您根本没有使用 JSF 2.2。您很可能只使用 TomEE 1.x,它随 JSF 2.1 一起提供。
此问题由 OmniFaces 2.2 触发。它需要 JSF 2.2。
您有 2 个选择:
我正在尝试将 Web 项目(WEB-INF/lib
中的所有 JAR)迁移到 Maven Web 项目(pom.xml
中的所有 JAR)。
此项目使用以下库:
- JSF 2.2
- PrimeFaces
- BootsFaces
- OmniFaces
它在 TomEE 上运行。
TomEE启动出现如下错误:
NoClassDefFoundError: javax/faces/component/UIViewAction
但是 JSF2 库是由 TomEE 在类路径上提供的。
这是我的 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.lb</groupId>
<artifactId>XXX</artifactId>
<version>0.0.1</version>
<packaging>war</packaging>
<name>XXX</name>
<description>Application XXX</description>
<url>http://XXX.fr</url>
<organization>
<name>XXX</name>
<url>http://XXX.fr</url>
</organization>
<inceptionYear>2016</inceptionYear>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<javase.version>1.7</javase.version>
<javaee.version>7.0</javaee.version>
</properties>
<developers>
<developer>
<id>XXX</id>
<name>YYY</name>
<email>ZZZ@gmail.com</email>
</developer>
</developers>
<build>
<directory>${basedir}/target/${project.artifactId}-${project.version}</directory>
<finalName>XXX</finalName>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.java</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${javase.version}</source>
<target>${javase.version}</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<webResources>
<resource>
<directory>${basedir}/src/main/webapp/WEB-INF</directory>
<filtering>true</filtering>
<targetPath>WEB-INF</targetPath>
</resource>
<resource>
<directory>${basedir}/src/main/resources</directory>
<filtering>true</filtering>
<targetPath>WEB-INF/resources</targetPath>
</resource>
</webResources>
<webXml>${basedir}/src/main/webapp/WEB-INF/web.xml</webXml>
<warSourceDirectory>${basedir}/src/main/webapp</warSourceDirectory>
<packagingExcludes>
**/*.java,
</packagingExcludes>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.6</version>
</dependency>
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>5.3</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.10</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>org.primefaces.themes</groupId>
<artifactId>bootstrap</artifactId>
<version>1.0.10</version>
</dependency>
<dependency>
<groupId>net.bootsfaces</groupId>
<artifactId>bootsfaces</artifactId>
<version>0.8.1</version>
</dependency>
<dependency>
<groupId>org.omnifaces</groupId>
<artifactId>omnifaces</artifactId>
<version>2.2</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>prime-repo</id>
<name>PrimeFaces Maven Repository</name>
<url>http://repository.primefaces.org</url>
<layout>default</layout>
</repository>
</repositories>
感谢您的帮助。
class javax/faces/component/UIViewAction
是自 JSF 2.2 以来新增的。因此,您根本没有使用 JSF 2.2。您很可能只使用 TomEE 1.x,它随 JSF 2.1 一起提供。
此问题由 OmniFaces 2.2 触发。它需要 JSF 2.2。
您有 2 个选择: