voyent
javax.faces.FacesException: Cannot add the same component twice: javascript_runner  XML
Forum Index -> General Help
Author Message
TJones2015

Joined: 26/Jun/2015 02:25:08
Messages: 9
Offline


I am using JSF version 2.2.9 and ICEFaces 4.0.0 which is running on Tomcat 8. When trying to load an xhtml page i recieve the following exception:

Code:
Aug 05, 2015 11:57:17 AM com.sun.faces.application.view.FaceletViewHandlingStrategy handleRenderException
 SEVERE: Error Rendering View[/pages/Ports.xhtml]
 javax.faces.FacesException: Cannot add the same component twice: javascript_runner
 	at com.sun.faces.context.StateContext$DynamicAddRemoveListener.handleAddRemoveWithAutoPrune(StateContext.java:748)
 	at com.sun.faces.context.StateContext$DynamicAddRemoveListener.handleAdd(StateContext.java:675)
 	at com.sun.faces.context.StateContext$AddRemoveListener.processEvent(StateContext.java:347)
 	at com.sun.faces.context.StateContext$DynamicAddRemoveListener.processEvent(StateContext.java:565)
 	at javax.faces.event.SystemEvent.processListener(SystemEvent.java:108)
 	at javax.faces.event.ComponentSystemEvent.processListener(ComponentSystemEvent.java:118)
 	at com.sun.faces.application.ApplicationImpl.processListenersAccountingForAdds(ApplicationImpl.java:2218)
 	at com.sun.faces.application.ApplicationImpl.invokeViewListenersFor(ApplicationImpl.java:2036)
 	at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:290)
 	at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:245)
 	at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2253)
 	at javax.faces.component.UIComponentBase.doPostAddProcessing(UIComponentBase.java:1934)
 	at javax.faces.component.UIComponentBase.setParent(UIComponentBase.java:447)
 	at javax.faces.component.UIComponentBase$ChildrenList.add(UIComponentBase.java:2687)
 	at javax.faces.component.UIComponentBase$ChildrenList.add(UIComponentBase.java:2659)
 	at javax.faces.component.UIViewRoot.addComponentResource(UIViewRoot.java:533)
 	at org.icefaces.impl.event.JavaScriptRunnerSetup.processEvent(JavaScriptRunnerSetup.java:66)
 	at javax.faces.event.SystemEvent.processListener(SystemEvent.java:108)
 	at javax.faces.event.ComponentSystemEvent.processListener(ComponentSystemEvent.java:118)
 	at com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2169)
 	at com.sun.faces.application.ApplicationImpl.invokeListenersFor(ApplicationImpl.java:2142)
 	at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:301)
 	at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:245)
 	at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:856)
 	at javax.faces.component.UIViewRoot.encodeBegin(UIViewRoot.java:985)
 	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1854)
 	at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:430)
 	at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133)
 	at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
 	at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
 	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
 	at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
 	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
 	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:614)
 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
 	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:617)
 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
 	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
 	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668)
 	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1527)
 	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1484)
 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
 	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
 	at java.lang.Thread.run(Thread.java:744)


Does anybody know what could be causing this?

Thanks
TJones2015

Joined: 26/Jun/2015 02:25:08
Messages: 9
Offline


The following JIRA bug seems to relate to this issue:

http://jira.icesoft.org/browse/ICE-10335

Due to this, I have downloaded the parent bundle pom file(bundle-parent-4.1.0-20141115.001413-1.pom) from icefaces snapshot repository which should include a fix for the problem:

http://sventon.icesoft.org/svn/repos/repo/list/maven2/snapshots/org/icefaces/bundle-parent/4.1.0-SNAPSHOT/?revision=HEAD&bypassEmpty=true

I have placed this parent bundle pom.xml file in my companies artifactory so that I have a "safer" snapshot version. This artifactory then provides the dependency to then place into my projects pom.xml file:

Code:
<dependency>
     <groupId>org.icefaces</groupId>
     <artifactId>bundle-parent</artifactId>
     <version>4.1.0-20150806.075933-1</version>
     <type>pom</type>
 </dependency>


This is my pom.xml file which now has the icefeaces parent bundle dependency which comes from the artifactory:

Code:
<?xml version="1.0"?>
 <project
 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
 	xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 	<modelVersion>4.0.0</modelVersion>
 	<groupId>oag.com.reference</groupId>
 	<artifactId>web</artifactId>
 	<version>0.0.1-SNAPSHOT</version>
 	<name>ReferenceDataWeb </name>
 	<packaging>war</packaging>
 	<description>Reference data web project.</description>
 
 
 	<properties>
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 		<sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
 		<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
 	</properties>
 
 	<build>
 		<plugins>
 			<plugin>
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-jar-plugin</artifactId>
 				<version>2.6</version>
 				<configuration>
 					<archive>
 						<manifest>
 							<addClasspath>true</addClasspath>
 							<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
 						</manifest>
 					</archive>
 				</configuration>
 			</plugin>
 			<plugin>
 				<artifactId>maven-war-plugin</artifactId>
 				<configuration>
 					<webappDirectory>src/main/webapp</webappDirectory>
 				</configuration>
 			</plugin>
 			<plugin>
 				<artifactId>maven-compiler-plugin</artifactId>
 				<configuration>
 					<source>1.7</source>
 					<target>1.7</target>
 				</configuration>
 			</plugin>
 			<plugin>
 				<groupId>org.jacoco</groupId>
 				<artifactId>jacoco-maven-plugin</artifactId>
 				<version>0.7.0.201403182114</version>
 				<executions>
 					<execution>
 						<goals>
 							<goal>prepare-agent</goal>
 						</goals>
 					</execution>
 				</executions>
 				<configuration>
 					<destFile>${sonar.jacoco.reportPath}</destFile>
 				</configuration>
 			</plugin>
 		</plugins>
 	</build>
 
 	<dependencies>
 		<dependency>
 			<groupId>com.sun.faces</groupId>
 			<artifactId>jsf-api</artifactId>
 			<version>2.2.10</version>
 		</dependency>
 		<dependency>
 			<groupId>com.sun.faces</groupId>
 			<artifactId>jsf-impl</artifactId>
 			<version>2.2.10</version>
 		</dependency>
 
 		<!-- <dependency> -->
 		<!-- <groupId>org.icefaces</groupId> -->
 		<!-- <artifactId>icefaces-ace</artifactId> -->
 		<!-- <version>4.0.0</version> -->
 		<!-- </dependency> -->
 
 		<dependency>
 			<groupId>org.icefaces</groupId>
 			<artifactId>bundle-parent</artifactId>
 			<version>4.1.0-20150806.075933-1</version>
 			<type>pom</type>
 			<exclusions>
 				<exclusion>
 					<groupId>org.glassfish</groupId>
 					<artifactId>javax.faces</artifactId>
 				</exclusion>
 				<!-- <exclusion> -->
 				<!-- <groupId>javax.servlet</groupId> -->
 				<!-- <artifactId>javax.servlet-api</artifactId> -->
 				<!-- </exclusion> -->
 			</exclusions>
 		</dependency>
 
 		<dependency>
 			<groupId>com.oag.reference</groupId>
 			<artifactId>business</artifactId>
 			<version>0.0.1-SNAPSHOT</version>
 		</dependency>
 
 		<dependency>
 			<groupId>org.apache.poi</groupId>
 			<artifactId>poi</artifactId>
 			<version>3.7</version>
 		</dependency>
 
 		<dependency>
 			<groupId>org.icefaces.ace-themes</groupId>
 			<artifactId>ace-cupertino</artifactId>
 			<version>4.0.0</version>
 		</dependency>
 
 		<dependency>
 			<groupId>javax.servlet</groupId>
 			<artifactId>javax.servlet-api</artifactId>
 			<version>3.0.1</version>
 		</dependency>
 
 		<dependency>
 			<groupId>javax.servlet</groupId>
 			<artifactId>jstl</artifactId>
 			<version>1.2</version>
 		</dependency>
 
 	</dependencies>
 
 </project>
 


I have added a screenshot of how my artifactory has stored the bundle parent pom.xml. However, when cleaning my project and trying to build, no icefaces jar files are downloaded.

List of downlaoded jars from pom.xml:

ace-cupertino-4.0.0.jar
business-0.0.1-SNAPSHOT.jar
common-0.0.1-SNAPSHOT.jar
database-0.0.1-SNAPSHOT.jar
db2jcc4-1.0.0.jar
hamcrest-core-1.1.jar
javax.servlet-api-3.0.1.jar
jsf-api-2.2.10.jar
jsf-impl-2.2.10.jar
jstl-1.2.jar
junit-4.9.jar
mockito-all-1.9.5.jar
poi-3.7.jar


Can anybody help please?

Thanks
[Thumb - icefacesParentBundleExample.jpg]
 Filename icefacesParentBundleExample.jpg [Disk] Download
 Description
 Filesize 70 Kbytes
 Downloaded:  715 time(s)

judy.guglielmin

Joined: 20/Feb/2007 00:00:00
Messages: 1396
Offline


If you are using maven, take a look at your target bundle and ensure there is only a single icefaces jar there. Clean your project and your server work directories. If you are running the project within the IDE, you might want to try deploying it outside of the IDE and running the server outside, to ensure the IDE has not kept other versions of ICEfaces and JSF around.

Are you able to deploy the sample apps from the download bundle?
 
Forum Index -> General Help
Go to:   
Powered by JForum 2.1.7ice © JForum Team