We prove that the 2-sphere and the projective plane have a dense set, in the C2 topology, of C-infinity riemannian metrics which have a (generic) elliptic closed geodesic. In particular these riemannian metrics have a geodesic flow which is not ergodic and with positive topological entropy. This result recovers in the generic case a claim by Henri Poincare' and proves a conjecture by Michel Herman.