如何使用NetBeans 8.2在Wildfly 13中运行jsf mojarra 2.3? [英] How to run jsf mojarra 2.3 in wildfly 13 with netbeans 8.2?

查看:107
本文介绍了如何使用NetBeans 8.2在Wildfly 13中运行jsf mojarra 2.3?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在netbeans中创建了一个项目,并在创建faces_config.xml之后添加了jboss_jsf-api_2.3.但是我有一个错误:

由于一个或多个间接依赖项不可用,因此无法启动一个或多个服务

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模式(仅" JSF 2.2)启动. /p>

摘自最近的 WildFly 13发行文档

默认情况下,WildFly 13在EE7模式下启动.为了使用这些新功能,您必须启用EE8预览模式.这可以通过在启动过程中传递ee8.preview.mode属性来实现:

./standalone.sh -Dee8.preview.mode=true

还有其他选项可以启用此功能.来自同一文档:

或者,这可以通过使用新的standalone-ee8.xml配置启动服务器来实现,该配置仅在配置中包含该属性.

./standalone.sh -c standalone-ee8.xml

CLI还可以用于修改现有配置以添加此属性.例如:

embed-server --admin-only=true /system-property=ee8.preview.mode:add(value=true) stop-embedded-server

然后您应该拥有JSF 2.3

I created a project in netbeans and I add jboss_jsf-api_2.3 and after I created my faces_config.xml. But I have a error:

One or more services were unable to start due to one or more indirect dependencies not being available

faces config is:

<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>

and my pom is:

<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>

解决方案

Although Wildfly 13 contains most JavaEE 8 features, it by default starts in JavaEE 7 mode which is 'just' JSF 2.2.

From the very recent 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

There are other options too to enable this. From the same docs:

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

You should then have JSF 2.3

这篇关于如何使用NetBeans 8.2在Wildfly 13中运行jsf mojarra 2.3?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆