Mike Mike - 4 months ago 10
Java Question

ArrayIndexOutOfBoundsException when running range query in Accumulo

I am using Geomesa 1.1 to connect to Accumulo 1.6.2 with Java. I have no problems querying the database for specific attributes (specific column values). But when I try to run a range query (tried both time and geometric ranges) I get an error.

When I check the Accumulo logs I see this error:

exception while doing multi-scan
java.lang.ArrayIndexOutOfBoundsException: -1


But none of my code uses Arrays. The exception is thrown from the underlying library.

This is how I am constructing my
CQL
filter:

Filter cqlFilter = CQL.toFilter("BBOX(where, 160.0, 1.0, 170.0, 3.0)");


What might be causing the
java.lang.ArrayIndexOutOfBoundsException: -1
?

EDIT

Updated question and answer to make it clear it isn't a duplicate and provide more general help to future visitors.

Answer

Geomesa/Accumulo will misleadingly throw this red herring error if you pass an invalid/incorrect table name to toFilter. Before you spend a lot of time reading through general solutions to this problem and searching your code for bugs, be sure that you have the correct table name.