Hi! I am trying to use Table component, but i always get an error after fast scrolling:
java.lang.ArrayIndexOutOfBoundsException: 40
at com.vaadin.ui.Table.paintContent(Table.java:2166)
at com.vaadin.ui.AbstractComponent.paint(AbstractComponent.java:675)
at com.vaadin.terminal.gwt.server.CommunicationManager.paintAfterVariablechanges(CommunicationManager.java:492)
at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(CommunicationManager.java:331)
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
I am using vaading 6.1.5 and liferay 5.2.3. I also ran this code on pure tomcat 6.0.18. The result is the same. After that application is broken.
The code is simple:
table = new Table("Documents", new FilesystemContainer(new File("g:\\info")));
table.setWidth("100%");
table.addListener(this);
mainWindow.addComponent(table);
I tried to deploy sample portlet from youtube video
Vaadin application development - step-by-step and I use Vaadin 6.4.4 and Liferay 6.0.5 but I when I click on some item in a table to display its contentc I receive
following error:
java.lang.ArrayIndexOutOfBoundsException: 8
at com.vaadin.terminal.gwt.client.MouseEventDetails.deSerialize(MouseEventDetails.java:124)
at com.vaadin.ui.Table.handleClickEvent(Table.java:2140)
at com.vaadin.ui.Table.changeVariables(Table.java:1961)
You probably have a different version of Vaadin in your development environment than that on Liferay, and there is a version mismatch between the Vaadin JAR you have in the portlet and the widgetset of the one bundled with Liferay. With Liferay 6.x, you should not have a Vaadin JAR in your portlet but always refer to the shared one on the portal.
Try removing the Vaadin JAR from your project altogether, and adding a classpath entry pointing to the Vaadin JAR inside your Liferay installation - e.g. webapps/ROOT/WEB-INF/lib/vaadin.jar in the Tomcat installation package. Also, make sure your WEB-INF/liferay-plugin-package.properties has vaadin.jar included on the portal-dependency-jars list.
You might also need to clean up some Liferay working directories for the portlet, as Liferay does not remove JARs it has once copied into the deployment directory of the portlet.
Thank you very much Henri,
you are right. Liferay 6.0.5 uses Vaadin 6.3.4.
the vaadin-6.3.4.jar file is in the application war file even if the vaadin.jar is inside liferay-plugin-package.propertis file as dependency. But this is probably eclipse related.
here I am again,
I thought I have this solved. But now I have some strange behavior of portlet. When I add the portlet to page the whole page goes blank at it seems hanged up but I can’t find the readoand I need to manually refresh the page (F5) to display page with portlet.
Anyway I discovered that vaadin.jar is during hotDeploy of Liferay coppied to lib directory of portlet anyway.
I stopped the server, removed the jar file, and restarted the server (work and temp of tomcat emptied)
I received the error
Please, can you confirm the vaadin portlet should work without vaadin.jar in its lib directory?
I have vaadin.jar dependency in lifeary-plugin-package.properties
I have also seen something similar (not the whole page being blank, but the newly added portlet not appearing) - not sure if it is browser dependent or not. To be investigated, but I will be out of the office for a week. I’m not sure if there is already a ticket about this, please create one if there is none so that this is not forgotten.
This is how Liferay works - at least on Tomcat. It does not use the JARs mentioned in liferay-plugin-package.properties directly, but copies them to the portlet deployment directory. I believe this also helps Liferay isolate the class loaders used for each portlet deployment.
What is inconvenient about this copying of JARs (both from the portal and from the portlet WAR) is that if you e.g. upgrade a JAR in your portlet so that its name changes, you’ll have two different copies of the JAR in the deployment directory, possibly causing hard to debug classpath issues sometime later.
Note that these are far from being the only changes Liferay does - take a look e.g. at the generated/modified web.xml that is in the deployment directory of the portlet, very different from your own web.xml (if one exists in your portlet).
I was able to resolve this by playing with
.xml and
.properties configuration files of portlet, but i don’t know exactly what I have change. I will look into it this week.
How were you able to resolve the ArrayIndexOutOfBoundsException on the Table Component? I am building a simple proof of concept using Vaadin and the SQLContainer Add-on and can’t get away from this problem.
Here is my simple usage:
FreeformQuery query = new FreeformQuery(queryString.toString(), connectionPool);
query.setDelegate(new OracleFreeformStatementDelegate(queryString));
uiRuleContainer = new SQLContainer(query);
Table myTable = Table();
myTable.setContainerDataSource(uiRuleContainer);
When I scroll down the table I always receive:
Feb 25, 2011 2:44:28 PM com.vaadin.Application terminalError
SEVERE: Terminal error:
java.lang.ArrayIndexOutOfBoundsException: 66
at com.vaadin.ui.Table.paintContent(Table.java:2437)
at com.vaadin.ui.AbstractComponent.paint(AbstractComponent.java:754)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.writeUidlResponce(AbstractCommunicationManager.java:951)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.paintAfterVariableChanges(AbstractCommunicationManager.java:838)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(AbstractCommunicationManager.java:764)
at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(CommunicationManager.java:296)
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:483)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:879)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Thread.java:595)
Are you sure that your OracleFreeformStatementDelegate is behaving correctly? Most notably the getQueryStatement(int offset, int limit), which should return a query statement that, when executed, returns the data you wish to display in the table and getCountStatement(), which should return the number of rows returned by the query statement created in getQueryStatement.
My guess is that the offset and limit handling contains a mistake that makes the query return less columns than it should.
Test your implementation of OracleFreeformStatementDelegate first, and post again if you’re still having problems.
Thanks for the reply. You were right, I had a small issue in OracleFreeformStatementDelegate in getQueryStatement(int offset, int limit). I was incorrectly converting the offset and limit values to be used for Oracle type pagination (Unfortunately, Oracle does not have the LIMIT and OFFSET keywords such as in MySQL).
One thing I wanted to clarify on your response. Looking at the SQLContainer implementation, getCountStatement() is intended to return the total count of the recordset that backs the Container and not the count of records that are retrieved for lazy loading. In other words, getCountStatement() doesn’t have to deal with offset and limit.