IllegalArgumentException with tree component on new pages

UI Components for JSF
Post Reply
tonico
Posts: 51
Joined: 22 Aug 2010, 00:15

05 Sep 2010, 17:29

[*]Environment: JSF2 / Primefaces 2.1 - Glassfish 3.1

Description: I have created a tree composite element that contains a command button, a dialog and a tree component within that dialog. The command button lazy loads the tree, so its data is prepared, then it renders within the dialog. All works perfectly on my pages that contain existing data, but when I am to add new data to the page the action to show the tree bombs-out, so I just see a blank dialog content and my logs reveal the following exception below

Observation 1:
The data to be show on the tree is already available on a session controller. It does not depend on the page being added's data.

Observation 2: Debugging this issue, the method that prepares the tree data is not even fired, therefore the exception occurs during some internal JSF / PrimeFaces UI rendering processing.

Observation 3:
I have another similar component that also works, but has this exact same problem when there is non initiated fields on the page. Again, the trees do not depend at all on the page's items

Observation 4: The exceotion is arround DataTable component, but we are dealing with a Tree component. I believe the tree's internal implementation depends on a DataTable. Overall, I mean there is no direct data table on my dialogs.

Code: Select all

java.lang.IllegalArgumentException: -1
        at javax.faces.component.UIData.setRows(UIData.java:502)
        at org.primefaces.component.datatable.DataTable.processDecodes(DataTable.java:378)
        at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1042)
        at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1042)
        at org.primefaces.component.tabview.TabView.processDecodes(TabView.java:154)
        at javax.faces.component.UIForm.processDecodes(UIForm.java:216)
        at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1042)
        at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1042)
        at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1042)
        at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1042)
        at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:941)
        at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78)
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
        at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
        at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
        at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
        at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
        at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
        at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
        at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
        at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
        at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
        at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
        at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
        at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
        at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
        at java.lang.Thread.run(Thread.java:619)
- Tonico
Primefaces 2.2.1 - Glassfish 3.1 - Mac OS X Lion

callahan
Posts: 768
Joined: 27 May 2010, 22:52

05 Sep 2010, 19:18

Hi,

Does the stacktrace not indicate that page has a TabView (NOT a TreeView) with a DataTable that is causing the problem?

tonico
Posts: 51
Joined: 22 Aug 2010, 00:15

07 Sep 2010, 22:26

Thanks Callahan, your observation is correct. Many thanks for pointing it out. After further exploration I have found the issue to be actually a bug ( in my opinion ) around the p:dataTable component. I have made a series of combined attempts and isolated the cause to the dynamic attribute of the dataTable. Overall, when dynamic="false" (which is the default) it will case the exception, but when dynamic="true" it will not, and then works fine.

Because the value ( true or false ) of the dataTable's dynamic attribute should work seamless ( just changing the processing to local javascript or server side, I believe this is a bug somewhere in the logic.

To reiterate:

- issue caused on a new form data having dataTable in it. My layout is a bit complex, with nested layout , tab view and dynamic includes
- dataTable with dynamic="false" or without the dynamic attribute ( since false is default ) throws the exception above when a dialog pops up or another ajax action executes
- dataTable with dynamic="true" works around this problem.
- Tonico
Primefaces 2.2.1 - Glassfish 3.1 - Mac OS X Lion

callahan
Posts: 768
Joined: 27 May 2010, 22:52

07 Sep 2010, 23:20

PrimeFaces 2.2 will come with a completly new DataTable. The dynamic property appears to have been removed, so paging is always handled by ajax, i.e., dynamic is always true. At least that's the way it's currently implemented.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 16 guests