Charmonium resonances on the lattice