Integrability of Hamiltonian systems on cantor sets