question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ArrayIndexOutOfBoundsException when use PF datatable exporter programmatically

See original GitHub issue

Hi, Our system is generating the pages programmatically, we used to use datatable exporter in PFExt, but when we upgraded the versions we moved to use the one in PF, and now we got the below exception.

Mojarra JSF 2.3.14 (Specification 2.3) Primefaces 11.0.0 Weblogic 14.1.1.0.0 Java 1.8

I have attached a very simple project which generate datatable and exporter, when we tried to use the exporter we got the below exception. Thanks


<h:form id="mainForm" enctype="multipart/form-data">
<pe:layout id="mainLayout" fullPage="true" widgetVar="mainLayout">
	<pe:layoutPane id="otbo-main" resizable="false" position="center" >
		<h:panelGroup id="applicationRoot" binding="#{rootBean.rootApp}" />
	</pe:layoutPane>
</pe:layout>
</h:form>

//create dataTable
	private void initDataTable() {
		DataTable dataTable = (DataTable) getApplication().createComponent( DataTable.COMPONENT_TYPE);
		dataTable.setId("myDataTable");
		
		dataTable.setVar( "row" );
		dataTable.setLazy( false );
		dataTable.setResizableColumns( true );
		dataTable.setReflow( true );
		
		dataTable.setRowKey("name");
		
		createExporters( dataTable );
		
		addColumn("Name", "name", dataTable);
		addColumn("City", "city", dataTable);
		addColumn("Age", "age", dataTable);
		
		dataTable.setValueExpression( "value", createValueExpression( "#{rootBean.data}", List.class ));
		
		addChild(rootApp, dataTable);
		
		
	}
	
	//create exporter
	private void createExporters( DataTable dataTable ) {
		CommandLink link = createComponent( CommandLink.COMPONENT_TYPE );
		link.setValue("Export table");
		
		DataExporter exporter = new DataExporter( createValueExpression( dataTable.getId(), String.class ),
				createValueExpression( "xlsx", String.class ), createValueExpression( "excelOut", String.class ), 
				null, null,	null, null, null, null, null);
		link.addActionListener( exporter );

		HtmlPanelGroup group = createComponent( HtmlPanelGroup.COMPONENT_TYPE );
		addChild( group, link );

		addChild(rootApp, group);
	}

<09-Feb-2022 11:21:26,012 o’clock GMT> <Error> <javax.enterprise.resource.webcontainer.jsf.context> <BEA-000000> <java.lang.ArrayIndexOutOfBoundsException: 10 at javax.faces.component.UIComponentBase.restoreChildState(UIComponentBase.java:3418) at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1026) at javax.faces.component.UIComponentBase.restoreFacetsState(UIComponentBase.java:3445) at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1029) at javax.faces.component.UIViewRoot.processRestoreState(UIViewRoot.java:932)

PrimefacesTester.zip

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
TEAMS-HRMcommented, Feb 10, 2022

thanks. I update the JSF implementation to higher version and it worked

           <dependency>
		<groupId>org.glassfish</groupId>
		<artifactId>javax.faces</artifactId>
		<version>2.3.3.102</version>
	</dependency>
0reactions
mellowarecommented, Feb 10, 2022

Cool I added the workaround label to this ticket thanks for reporting back!

Read more comments on GitHub >

github_iconTop Results From Across the Web

jsf - Primefaces 10 dataTable p:dataExporter generate ...
I have migrated from primefaces 8 to primefaces 10 dataTable p:dataExporter generate ArrayIndexOutOfBoundsException on render the xhtml.
Read more >
Bug « PrimeFaces « JSF Q&A - Java2s.com
DataExporter ignores the rendered attribute of a column. 1. Create a new datatable and dataexporter 2. Hide a column on the datatable by...
Read more >
DataExporter Basic - PrimeFaces Showcase
The datatable columns content will be justified as left aligned, center aligned and right aligned based on the content type. If a style...
Read more >
Fix list for IBM WebSphere Application Server V8.5
IBM WebSphere Application Server provides periodic fixes for the base and Network Deployment editions of release V8.5. The following is a complete listing ......
Read more >
The jOOQ Release Note History
#14334, ArrayIndexOutOfBoundsException when parsing ill formed SQL ending with a ... To make use of these, combine them with the new synthetic column ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found