简体   繁体   English

JBoss 7.1,JSF,RichFaces-丰富的组件不想渲染

[英]JBoss 7.1, JSF, RichFaces - rich components don't want to render

I'm learing RichFaces now for my JSF project, but i have problem with rendering rich components in my enviroment. 我现在为我的JSF项目租用RichFaces,但是在环境中渲染富组件时遇到了问题。

I have added RichFaces jar(all 4 jars from RichFaces page) to JBoss modules (E:\\JBoss\\modules\\org\\richfaces\\main) with module.xml: 我使用module.xml将RichFaces jar(RichFaces页面上的所有4个jar)添加到JBoss模块(E:\\ JBoss \\ modules \\ org \\ richfaces \\ main)中:

<module xmlns="urn:jboss:module:1.1" name="org.richfaces">
<resources>
<resource-root path="richfaces-components-api-4.2.1.Final.jar"/>
<resource-root path="richfaces-components-ui-4.2.1.Final.jar"/>
<resource-root path="richfaces-core-api-4.2.1.Final.jar"/>
<resource-root path="richfaces-core-impl-4.2.1.Final.jar"/>
<!-- Insert resources here -->
</resources>
<dependencies>
<module name="org.w3c.css.sac"/>
<module name="net.sourceforge.cssparser"/>
<module name="com.sun.jsf-impl"/>
<module name="javax.api"/>
<module name="javax.faces.api"/>
<module name="javax.xml.bind.api"/>
<module name="javax.xml.jaxp-provider"/>
<module name="com.google.guava"/>
</dependencies>
</module>

All dependencies were added to jboss modules by default configuration. 默认情况下,所有依赖项都已添加到jboss模块。

I created simple JSF page with RichFaces from tutorial: 我从教程中使用RichFaces创建了简单的JSF页面:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:a4j="http://richfaces.org/a4j">

<h:head></h:head>
<body>
    <rich:panel>
        <f:facet name="header">
        Write your own custom rich components with built-in AJAX support
        </f:facet>
        <h:outputText value="Panel Body" />
    </rich:panel>
    <rich:panel>
        <f:facet name="header">
        Write your own custom rich components with built-in AJAX support
        </f:facet>
        <h:outputText value="Panel Body" />
        <a4j:form>
            <h:outputText value="The integer version of the selected color:" />
            <h:outputText id="RGBvalue" value="#{colorPickerBean.color}" />
            <rich:panel header="RichFaces Color Picker" style="width: 315px">
                <rich:colorPicker value="#{colorPickerBean.color}" colorMode="rgb"
                    converter="org.richfaces.IntegerColor">
                    <a4j:support event="onchange" reRender="RGBvalue" />
                </rich:colorPicker>
            </rich:panel>
        </a4j:form>
    </rich:panel>

</body>
</html>

Both xmlns in head tag are highlighted with "NLS missing message: CANNOT_FIND_FACELET_TAGLIB in: org.eclipse.jst.jsf.core.validation.internal.facelet.messages" head标记中的两个xmlns都用“ NLS丢失消息:org.eclipse.jst.jsf.core.validation.internal.facelet.messages中的CANNOT_FIND_FACELET_TAGLIB突出显示”

I've deployed my new xhtml page for JBoss and now rich components aren't handled proper. 我已经为JBoss部署了新的xhtml页面,但是现在无法正确处理丰富的组件。 Next listing shows source of deployed page. 接下来的清单显示了已部署页面的来源。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j"><head></head>
<body>
    <rich:panel>Panel Body
    </rich:panel>
    <rich:panel>Panel Body
        <a4j:form>The integer version of the selected color:<span id="RGBvalue"></span>
            <rich:panel header="RichFaces Color Picker" style="width: 315px">
                <rich:colorPicker colorMode="rgb" converter="org.richfaces.IntegerColor">
                    <a4j:support event="onchange" reRender="RGBvalue"></a4j:support>
                </rich:colorPicker>
            </rich:panel>
        </a4j:form>
    </rich:panel>

</body>
</html>

My jboss-deployment-structure.xml in WebContent/META-INF: 我在WebContent / META-INF中的jboss-deployment-structure.xml:

<jboss-deployment-structure>
    <sub-deployment name="Tutorial2.war">
        <dependencies>
            <module name="org.richfaces" slot="main">
                <imports>
                    <include path="**" />
                </imports>
            </module>
        </dependencies>
    </sub-deployment>
</jboss-deployment-structure>

Modules defines as showed in link https://issues.jboss.org/browse/RF-12008 模块定义如链接https://issues.jboss.org/browse/RF-12008所示

After few more changes I got 经过几次更改后,我得到了

00:29:52,455 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC00001: Failed to start service jboss.deployment.unit."Tutorial2.war".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."Tutorial2.war".STRUCTURE: Failed to process phase STRUCTURE of deployment "Tutorial2.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(Unknown Source) [rt.jar:1.6.0_31]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.6.0_31]
    at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_31]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Sub deployment Tutorial2.war in jboss-structure.xml was not found. Available sub deployments: 
    at org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.subDeploymentNotFound(DeploymentStructureDescriptorParser.java:233) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.deploy(DeploymentStructureDescriptorParser.java:159) [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

Error occurs as soon as I add jboss-deployment-structure.xml to WEB-INF. 一旦将jboss-deployment-structure.xml添加到WEB-INF,就会发生错误。

This looks like it's probably an issue with eclipse. 看来这可能是日食的问题。 It seems there are a few different questions along the same lines with eclipse and JSF. 似乎在与eclipse和JSF相同的地方存在一些不同的问题。 Most of them seem to say something this one does. 他们中的大多数人似乎都在说这个

see following discussion on jboss forum https://community.jboss.org/message/633025#633025 and search for the correnct answer 请参阅jboss论坛https://community.jboss.org/message/633025#633025上的以下讨论并搜索正确的答案

you should supply jboss7 specific deployment descriptor jboss_deployment_structure.xml to make richfaces module available to your application 您应该提供特定于jboss7的部署描述符jboss_deployment_structure.xml,以使Richfaces模块可用于您的应用程序

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM