我是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>
如何纠正此错误?帮助我。
答案 0 :(得分: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
答案 1 :(得分: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>