I have an idea
First I have to write dJointAttach, and after attaching dJointSetBallAnchor. It is not clear to me why but it works in this order.