如何使用 netbeans 8.2 运行 wildfly 13 中的 jsf mojarra 2.3?
How to run jsf mojarra 2.3 in wildfly 13 with netbeans 8.2?
我在 netbeans 中创建了一个项目,我添加了 jboss_jsf-api_2.3,然后我创建了我的 faces_config.xml。但是我有一个错误:
由于一个或多个间接依赖项不可用,一个或多个服务无法启动
faces 配置是:
<faces-config
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_3.xsd"
version="2.3">
</faces-config>
我的 pom 是:
<dependencies>
<dependency>
<groupId>org.jboss.spec.javax.faces</groupId>
<artifactId>jboss-jsf-api_2.3_spec</artifactId>
<version>2.3.5.SP1</version>
</dependency>
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>6.2</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.3.1.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
</dependencies>
尽管 Wildfly 13 包含 大多数 JavaEE 8 功能,但它默认以 JavaEE 7 模式启动,即 'just' JSF 2.2。
从最近的 WildFly 13 release documentation
By default WildFly 13 launches in EE7 mode. In order to use these new capabilities you have to enable EE8 preview mode. This can be accomplished by passing the ee8.preview.mode property during startup:
./standalone.sh -Dee8.preview.mode=true
还有其他选项可以启用此功能。来自相同的文档:
Alternatively, this can be achieved by launching the server using the new standalone-ee8.xml configuration, which simply includes the property in the config.
./standalone.sh -c standalone-ee8.xml
The CLI can also be used to modify the existing configuration to add this property. For example:
embed-server --admin-only=true
/system-property=ee8.preview.mode:add(value=true)
stop-embedded-server
然后你应该有 JSF 2.3
我在 netbeans 中创建了一个项目,我添加了 jboss_jsf-api_2.3,然后我创建了我的 faces_config.xml。但是我有一个错误:
由于一个或多个间接依赖项不可用,一个或多个服务无法启动
faces 配置是:
<faces-config
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_3.xsd"
version="2.3">
</faces-config>
我的 pom 是:
<dependencies>
<dependency>
<groupId>org.jboss.spec.javax.faces</groupId>
<artifactId>jboss-jsf-api_2.3_spec</artifactId>
<version>2.3.5.SP1</version>
</dependency>
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>6.2</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.3.1.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
</dependencies>
尽管 Wildfly 13 包含 大多数 JavaEE 8 功能,但它默认以 JavaEE 7 模式启动,即 'just' JSF 2.2。
从最近的 WildFly 13 release documentation
By default WildFly 13 launches in EE7 mode. In order to use these new capabilities you have to enable EE8 preview mode. This can be accomplished by passing the ee8.preview.mode property during startup:
./standalone.sh -Dee8.preview.mode=true
还有其他选项可以启用此功能。来自相同的文档:
Alternatively, this can be achieved by launching the server using the new standalone-ee8.xml configuration, which simply includes the property in the config.
./standalone.sh -c standalone-ee8.xml
The CLI can also be used to modify the existing configuration to add this property. For example:
embed-server --admin-only=true /system-property=ee8.preview.mode:add(value=true) stop-embedded-server
然后你应该有 JSF 2.3