I get the same error with one of my distributions.
Reading the Javadoc of this class, it says the following:
USAGE NOTES:
The binCount is set by default to 1000. A good rule of thumb
is to set the bin count to approximately the length of the input
file divided by 10.
I've initialised my EmpiricalDistribution
with a binCount equals to 10% of my initial data length and now everything is working ok:
double[] baseLine = getBaseLineValues();
...
// Initialise binCount
distribution = new EmpiricalDistribution(baseLine.length/10);
// Load base line data
distribution.load(baseLine);
// Now you can obtain random values based on this distribution
double randomValue = distribution.getNextValue();