An attempt to read beyond the end of stream occurred, why?

I'm trying to get the search to be done in the database and present it in XHTML, but I tried it in different ways using an interator, etc. In this last attempt the error is that Stream is unable to read the constant (apparently)

try {
            CursoredStream cursor = gestaoReceitasComerciaisEAO
            Object[] record = null;         
            while (cursor.hasNext()) {
                Object[] conta = (Object[]);
                ContaVO contaVO = new ContaVO();
                // validar se é null
                contaVO.setFlagAbatimentoOrigem((BigDecimal)(conta[2] == null ? 0 : contaVO.getFlagAbatimentoOrigem()));                
                contaVO.setNmRepresentante((String)conta[3] == null ? "" : contaVO.getNmRepresentante());


        } catch (Exception e) {
            logger.log(Level.SEVERE, e.getMessage(), e);
            throw new ContaException("Conta não encontrada", e);
        return listaContasVO;


Read more here:

Content Attribution

This content was originally published by Paulo Oliveira at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: