 He was trained by the Jesuits shortly before their expulsion, and attended the Real Colegio de San Carlos in Buenos Aires.As was customary, one of the children of the Castelli family was ordained into the priesthood, and Juan José was chosen for this.He was sent to study at the Colegio Monserrat, part of the University of Córdoba.