【问题标题】:JSF: javax.faces.FacesException: Cannot add the same component twice: vaz4n2-retrieve-updateJSF:javax.faces.FacesException:不能两次添加相同的组件:vaz4n2-retrieve-update
【发布时间】:2013-09-18 13:05:58
【问题描述】:

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

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

【问题讨论】:

  • @BeginnerJava:库/框架/API 名称,如“ICEFaces”、“Tomcat”等不是代码!请停止将它们错误地格式化为建议编辑中的代码。
  • @BalusC 我之所以编辑是因为我看到它在几篇文章中被用作突出重要单词的一种方式,(我发现通过这些文章很有帮助)。谢谢你告诉我。
  • @BeginnerJava:阅读标签 [review-abuse] 上的 meta.stackoverflow.com。

标签: jsf eclipse-plugin icefaces-3


【解决方案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#sthash.qxEkXX1Q.dpbs

【讨论】:

    【解决方案2】:

    通过将 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>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-07-10
      • 1970-01-01
      • 2020-09-05
      • 2012-01-02
      • 2021-03-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多