2

我是 JSF 初学者。我尝试在 Eclipse 4.2 (Juno) 中实现 ICEfaces 3.0 组件。我已经使用 Apache Tomcat 7.0 实现并运行它。它在窗口中显示以下错误:

不能两次添加相同的组件

在控制台栏中,它显示为:

javax.faces.FacesException: Cannot add the same component twice: v8z4ho2-retrieve-update

我的 JSF 代码

<?xml version='1.0' encoding='UTF-8' ?>
<!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:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:icecore="http://www.icefaces.org/icefaces/core"  
    xmlns:ace="http://www.icefaces.org/icefaces/components"   
    xmlns:ice="http://www.icesoft.com/icefaces/component" >

<h:head>
    <title>Chart</title>
    <link rel="stylesheet" type="text/css" href="./xmlhttp/css/rime/rime.css"/>
</h:head>

<h:body styleClass="ice-skin-rime">     
    <h:form id="canvasForm">
        <ace:chart id="chart" animated="false" value="#{chartBean.barData}"
            stackSeries="false" defaultAxesConfig="#{chartBean.barDemoDefaultAxis}"
            xAxis="#{chartBean.barDemoXAxis}" yAxis="#{chartBean.barDemoYAxis}"
            legend="true"  legendPlacement="OUTSIDE_GRID" highlighter="true"
            highlighterLocation="N" highlighterShowMarker="false"       
            highlighterBringSeriesToFront="true"
            widgetVar="barChart" />
    </h:form>    
</h:body>
</html>

如何纠正这个错误?帮帮我。

4

2 回答 2

1

在 ICEFaces 论坛中,我发现很多人都有这个问题。如果您使用的是 Tomcat 7.0.42,请尝试使用 Tomcat 7.0.41,看看它是否有效。还要检查在同一个类路径中是否有重复的 icefaces jar(或 icefaces.jar 和 icefaces-ee.jar)。帖子的链接是:

http://www.icesoft.org/JForum/posts/list/22121.page#stash.qxEkXX1Q.dpbs

于 2013-09-18T13:34:28.607 回答
1

通过将 icefaces 版本从 3.3.0 恢复到 3.0.1 来修复:

    <!-- Ices Dependencies -->
    <dependency>
        <groupId>org.icefaces</groupId>
        <artifactId>icefaces</artifactId>
        <version>3.0.1</version>
    </dependency>

    <dependency>
        <groupId>org.icefaces</groupId>
        <artifactId>icefaces-ace</artifactId>
        <version>3.0.1</version>
    </dependency>

    <dependency>
        <groupId>org.icefaces</groupId>
        <artifactId>icefaces-compat</artifactId>
        <version>3.0.1</version>
    </dependency>

    <dependency>
        <groupId>org.icepush</groupId>
        <artifactId>icepush</artifactId>
        <version>3.1.0</version>
    </dependency>
于 2014-07-08T12:47:17.257 回答