ArrayIndexOutOfBoundsException when using restartApplication url

Hi All,

I am getting an ArrayIndexOutOfBoundsException when I use the
url as explained below.

I have a
class that extends

public class SettingsWindow extends Window {
	private QueryliteService queryliteService;
	public SettingsWindow() {
		VerticalLayout driverSettingsLayout = new VerticalLayout();
		Component driverSettings = getDriverSettings();
	private Component getDriverSettings() {
		Tree driversTree = new Tree("");
	private void buildDriversTree(Tree driversTree) {
  		for(int i=1;i<10;i++) {
  			driversTree.addItem("driver" + i);

With the above code, the application works fine. I can open the SettingsWindow and it shows me the tree with the items driver0 to driver9. I can restart the application using the
url without any problem.

However, if I change the
method as shown below :

	private void buildDriversTree(Tree driversTree) {
		List<DriverType> driverTypes = queryliteService.getAllDriverTypes();
		for(DriverType driverType : driverTypes) {

The application starts and works fine. I can open the SettingsWindow and it shows me the tree with the items from the database. But when I use the
url, it fails with the following exception:

SEVERE: Servlet.service() for servlet [Querylite Vaadin Application Servlet]
 in context with path 
[/querylite] threw exception
	at java.lang.System.arraycopy(Native Method)
	at org.apache.tomcat.util.buf.ByteChunk.append(
	at org.apache.tomcat.util.http.Parameters.processParameters(
	at org.apache.tomcat.util.http.Parameters.processParameters(
	at org.apache.tomcat.util.http.Parameters.handleQueryParameters(
	at org.apache.catalina.connector.Request.parseParameters(
	at org.apache.catalina.connector.Request.getParameter(
	at org.apache.catalina.connector.RequestFacade.getParameter(
	at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.isRepaintAll(
	at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(
	at javax.servlet.http.HttpServlet.service(
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(
	at org.apache.catalina.core.StandardWrapperValve.invoke(
	at org.apache.catalina.core.StandardContextValve.invoke(
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(
	at org.apache.catalina.core.StandardHostValve.invoke(
	at org.apache.catalina.valves.ErrorReportValve.invoke(
	at org.apache.catalina.valves.AccessLogValve.invoke(
	at org.apache.catalina.core.StandardEngineValve.invoke(
	at org.apache.catalina.connector.CoyoteAdapter.service(
	at org.apache.coyote.http11.AbstractHttp11Processor.process(
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
	at java.util.concurrent.ThreadPoolExecutor$

Is there something wrong with the way I am handling the tree component with dynamic data as opposed to static data?

I can’t spot any problem with your code. Furthermore, the stacktrace indicates that your Tomcat has some serious problem as it dies on a simple call to HttpServletRequest.getParameter. I found some similar Tomcat bugs that have been fixed many years ago so this shouldn’t be the cause if you’re using Tomcat 6 or Tomcat 7.

Some reports seem to suggest that some similar Tomcat problems might be related to big headers or a very long query string in the request. None of those things seem to be related to how you are populating the tree.

On thing that you could check is if the call to queryliteService.getAllDriverTypes() by itself has any side effects that happen even if you don’t add the data to the Tree (nor any other Vaadin component).

Another option is if the data you get from driverType.getName() contains some weird (possibly invisible) characters that trigger might trigger some obscure bug in Vaadin or in Tomcat.